mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
refactor: deprecate login_before_ready in favor of startup_script_behavior (#7837)
Fixes #7758
This commit is contained in:
+12
@@ -0,0 +1,12 @@
|
||||
BEGIN;
|
||||
|
||||
ALTER TABLE workspace_agents ADD COLUMN login_before_ready boolean NOT NULL DEFAULT TRUE;
|
||||
|
||||
UPDATE workspace_agents SET login_before_ready = CASE WHEN startup_script_behavior = 'non-blocking' THEN TRUE ELSE FALSE END;
|
||||
|
||||
ALTER TABLE workspace_agents DROP COLUMN startup_script_behavior;
|
||||
DROP TYPE startup_script_behavior;
|
||||
|
||||
COMMENT ON COLUMN workspace_agents.login_before_ready IS 'If true, the agent will delay logins until it is ready (e.g. executing startup script has ended).';
|
||||
|
||||
COMMIT;
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
BEGIN;
|
||||
|
||||
CREATE TYPE startup_script_behavior AS ENUM ('blocking', 'non-blocking');
|
||||
ALTER TABLE workspace_agents ADD COLUMN startup_script_behavior startup_script_behavior NOT NULL DEFAULT 'non-blocking';
|
||||
|
||||
UPDATE workspace_agents SET startup_script_behavior = (CASE WHEN login_before_ready THEN 'non-blocking' ELSE 'blocking' END)::startup_script_behavior;
|
||||
|
||||
ALTER TABLE workspace_agents DROP COLUMN login_before_ready;
|
||||
|
||||
COMMENT ON COLUMN workspace_agents.startup_script_behavior IS 'When startup script behavior is non-blocking, the workspace will be ready and accessible upon agent connection, when it is blocking, workspace will wait for the startup script to complete before becoming ready and accessible.';
|
||||
|
||||
COMMIT;
|
||||
Reference in New Issue
Block a user