mirror of
https://github.com/coder/coder.git
synced 2025-07-13 21:36:50 +00:00
feat: add agent metadata (#6614)
This commit is contained in:
@ -0,0 +1 @@
|
||||
DROP TABLE workspace_agent_metadata;
|
@ -0,0 +1,16 @@
|
||||
-- This table is UNLOGGED because it is very update-heavy and the the data
|
||||
-- is not valuable enough to justify the overhead of WAL logging. This should
|
||||
-- give us a ~70% improvement in write throughput.
|
||||
CREATE UNLOGGED TABLE workspace_agent_metadata (
|
||||
workspace_agent_id uuid NOT NULL,
|
||||
display_name varchar(127) NOT NULL,
|
||||
key varchar(127) NOT NULL,
|
||||
script varchar(65535) NOT NULL,
|
||||
value varchar(65535) NOT NULL DEFAULT '',
|
||||
error varchar(65535) NOT NULL DEFAULT '',
|
||||
timeout bigint NOT NULL,
|
||||
interval bigint NOT NULL,
|
||||
collected_at timestamp with time zone NOT NULL DEFAULT '0001-01-01 00:00:00+00',
|
||||
PRIMARY KEY (workspace_agent_id, key),
|
||||
FOREIGN KEY (workspace_agent_id) REFERENCES workspace_agents(id) ON DELETE CASCADE
|
||||
);
|
18
coderd/database/migrations/testdata/fixtures/000111_workspace_agent_metadata.up.sql
vendored
Normal file
18
coderd/database/migrations/testdata/fixtures/000111_workspace_agent_metadata.up.sql
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
INSERT INTO
|
||||
workspace_agent_metadata (
|
||||
workspace_agent_id,
|
||||
display_name,
|
||||
key,
|
||||
script,
|
||||
timeout,
|
||||
interval
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
'45e89705-e09d-4850-bcec-f9a937f5d78d',
|
||||
'a h e m',
|
||||
'ahem',
|
||||
'rm -rf',
|
||||
3,
|
||||
1
|
||||
);
|
Reference in New Issue
Block a user