Skip to content

Commit c18a401

Browse files
committed
Improve schema
1 parent 51b0079 commit c18a401

File tree

3 files changed

+25
-9
lines changed

3 files changed

+25
-9
lines changed

coderd/database/migrations/000152_workspace_agent_script.up.sql

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
BEGIN;
2+
CREATE TABLE workspace_agent_log_source (
3+
workspace_agent_id uuid NOT NULL,
4+
id uuid NOT NULL,
5+
created_at timestamptz NOT NULL,
6+
display_name varchar(127) NOT NULL,
7+
icon text NOT NULL,
8+
PRIMARY KEY (workspace_agent_id, id)
9+
);
10+
11+
CREATE TABLE workspace_agent_script (
12+
workspace_agent_id uuid NOT NULL,
13+
log_source_id uuid NOT NULL,
14+
created_at timestamptz NOT NULL,
15+
script text NOT NULL,
16+
schedule text NOT NULL,
17+
login_before_ready boolean NOT NULL,
18+
name varchar(127) NOT NULL,
19+
description text NOT NULL,
20+
PRIMARY KEY (workspace_agent_id, id)
21+
);
22+
23+
-- Set the table to unlogged to speed up the inserts
24+
ALTER TABLE workspace_agent_logs SET UNLOGGED;
25+
COMMIT;

0 commit comments

Comments
 (0)