mirror of
https://github.com/coder/coder.git
synced 2026-06-06 22:48:19 +00:00
chore: change max share level on existing port shares (#12411)
This commit is contained in:
@@ -11,3 +11,9 @@ DELETE FROM workspace_agent_port_share WHERE workspace_id = $1 AND agent_name =
|
||||
INSERT INTO workspace_agent_port_share (workspace_id, agent_name, port, share_level)
|
||||
VALUES ($1, $2, $3, $4)
|
||||
ON CONFLICT (workspace_id, agent_name, port) DO UPDATE SET share_level = $4 RETURNING *;
|
||||
|
||||
-- name: ReduceWorkspaceAgentShareLevelToAuthenticatedByTemplate :exec
|
||||
UPDATE workspace_agent_port_share SET share_level = 'authenticated' WHERE share_level = 'public' AND workspace_id IN (SELECT id FROM workspaces WHERE template_id = $1);
|
||||
|
||||
-- name: DeleteWorkspaceAgentPortSharesByTemplate :exec
|
||||
DELETE FROM workspace_agent_port_share WHERE workspace_id IN (SELECT id FROM workspaces WHERE template_id = $1);
|
||||
|
||||
Reference in New Issue
Block a user