-
Notifications
You must be signed in to change notification settings - Fork 979
chore: allow multiple agent subsystems, add exectrace #8933
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
BEGIN; | ||
|
||
-- Bring back the subsytem column. | ||
ALTER TABLE workspace_agents ADD COLUMN subsystem workspace_agent_subsystem NOT NULL DEFAULT 'none'; | ||
|
||
-- Update all existing workspace_agents to have subsystem = subsystems[0] unless | ||
-- subsystems is empty. | ||
UPDATE workspace_agents SET subsystem = subsystems[1] WHERE cardinality(subsystems) > 0; | ||
|
||
-- Drop the subsystems column from workspace_agents. | ||
ALTER TABLE workspace_agents DROP COLUMN subsystems; | ||
|
||
-- We cannot drop the "exectrace" value from the workspace_agent_subsystem type | ||
-- because you cannot drop values from an enum type. | ||
UPDATE workspace_agents SET subsystem = 'none' WHERE subsystem = 'exectrace'; | ||
|
||
COMMIT; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
BEGIN; | ||
|
||
-- Add "exectrace" to workspace_agent_subsystem type. | ||
ALTER TYPE workspace_agent_subsystem ADD VALUE 'exectrace'; | ||
|
||
-- Create column subsystems in workspace_agents table, with default value being | ||
-- an empty array. | ||
ALTER TABLE workspace_agents ADD COLUMN subsystems workspace_agent_subsystem[] DEFAULT '{}'; | ||
|
||
-- Add a constraint that the subsystems cannot contain the deprecated value | ||
-- 'none'. | ||
ALTER TABLE workspace_agents ADD CONSTRAINT subsystems_not_none CHECK (NOT ('none' = ANY (subsystems))); | ||
|
||
-- Update all existing workspace_agents to have subsystems = [subsystem] unless | ||
-- the subsystem is 'none'. | ||
UPDATE workspace_agents SET subsystems = ARRAY[subsystem] WHERE subsystem != 'none'; | ||
|
||
-- Drop the subsystem column from workspace_agents. | ||
ALTER TABLE workspace_agents DROP COLUMN subsystem; | ||
|
||
COMMIT; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.