mirror of
https://github.com/coder/coder.git
synced 2026-06-07 23:18:20 +00:00
feat: store coder_workspace_tags in the database (#13294)
This commit is contained in:
Generated
+12
@@ -943,6 +943,12 @@ CREATE VIEW template_version_with_user AS
|
||||
|
||||
COMMENT ON VIEW template_version_with_user IS 'Joins in the username + avatar url of the created by user.';
|
||||
|
||||
CREATE TABLE template_version_workspace_tags (
|
||||
template_version_id uuid NOT NULL,
|
||||
key text NOT NULL,
|
||||
value text NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE templates (
|
||||
id uuid NOT NULL,
|
||||
created_at timestamp with time zone NOT NULL,
|
||||
@@ -1536,6 +1542,9 @@ ALTER TABLE ONLY template_version_parameters
|
||||
ALTER TABLE ONLY template_version_variables
|
||||
ADD CONSTRAINT template_version_variables_template_version_id_name_key UNIQUE (template_version_id, name);
|
||||
|
||||
ALTER TABLE ONLY template_version_workspace_tags
|
||||
ADD CONSTRAINT template_version_workspace_tags_template_version_id_key_key UNIQUE (template_version_id, key);
|
||||
|
||||
ALTER TABLE ONLY template_versions
|
||||
ADD CONSTRAINT template_versions_pkey PRIMARY KEY (id);
|
||||
|
||||
@@ -1797,6 +1806,9 @@ ALTER TABLE ONLY template_version_parameters
|
||||
ALTER TABLE ONLY template_version_variables
|
||||
ADD CONSTRAINT template_version_variables_template_version_id_fkey FOREIGN KEY (template_version_id) REFERENCES template_versions(id) ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE ONLY template_version_workspace_tags
|
||||
ADD CONSTRAINT template_version_workspace_tags_template_version_id_fkey FOREIGN KEY (template_version_id) REFERENCES template_versions(id) ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE ONLY template_versions
|
||||
ADD CONSTRAINT template_versions_created_by_fkey FOREIGN KEY (created_by) REFERENCES users(id) ON DELETE RESTRICT;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user