Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9d03a6a

Browse files
committed
Add new columns to workspace agent table
1 parent bd1a87f commit 9d03a6a

File tree

7 files changed

+44
-11
lines changed

7 files changed

+44
-11
lines changed

coderd/database/dump.sql

+3-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
ALTER TABLE workspace_agents DROP COLUMN startup_script_timeout;
2+
ALTER TABLE workspace_agents DROP COLUMN delay_login_until_ready;
3+
14
ALTER TABLE workspace_agents DROP COLUMN lifecycle_state;
25

36
DROP TYPE workspace_agent_lifecycle_state;

coderd/database/migrations/000091_add_workspace_agent_state.up.sql

+4
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@ CREATE TYPE workspace_agent_lifecycle_state AS ENUM ('created', 'starting', 'sta
33
ALTER TABLE workspace_agents ADD COLUMN lifecycle_state workspace_agent_lifecycle_state NOT NULL DEFAULT 'created';
44

55
COMMENT ON COLUMN workspace_agents.lifecycle_state IS 'The current lifecycle state of the workspace agent.';
6+
7+
/* Set default values from terraform-provider-coder v0.6.7 */
8+
ALTER TABLE workspace_agents ADD COLUMN delay_login_until_ready boolean NOT NULL DEFAULT false;
9+
ALTER TABLE workspace_agents ADD COLUMN startup_script_timeout int4 NOT NULL DEFAULT 300;

coderd/database/models.go

+3-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/queries.sql.go

+25-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/queries/workspaceagents.sql

+4-2
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,12 @@ INSERT INTO
5656
resource_metadata,
5757
connection_timeout_seconds,
5858
troubleshooting_url,
59-
motd_file
59+
motd_file,
60+
delay_login_until_ready,
61+
startup_script_timeout
6062
)
6163
VALUES
62-
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17) RETURNING *;
64+
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19) RETURNING *;
6365

6466
-- name: UpdateWorkspaceAgentConnectionByID :exec
6567
UPDATE

coderd/provisionerdserver/provisionerdserver.go

+2
Original file line numberDiff line numberDiff line change
@@ -949,6 +949,8 @@ func InsertWorkspaceResource(ctx context.Context, db database.Store, jobID uuid.
949949
ConnectionTimeoutSeconds: prAgent.GetConnectionTimeoutSeconds(),
950950
TroubleshootingURL: prAgent.GetTroubleshootingUrl(),
951951
MOTDFile: prAgent.GetMotdFile(),
952+
DelayLoginUntilReady: prAgent.GetDelayLoginUntilReady(),
953+
StartupScriptTimeout: prAgent.GetStartupScriptTimeout(),
952954
})
953955
if err != nil {
954956
return xerrors.Errorf("insert agent: %w", err)

0 commit comments

Comments
 (0)