mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: Allow template names to be re-used after deletion (#2454)
Fixes #2152
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
DROP INDEX templates_organization_id_name_idx;
|
||||
CREATE UNIQUE INDEX templates_organization_id_name_idx ON templates USING btree (organization_id, name) WHERE deleted = false;
|
||||
CREATE UNIQUE INDEX idx_templates_name_lower ON templates USING btree (lower(name));
|
||||
|
||||
ALTER TABLE ONLY templates ADD CONSTRAINT templates_organization_id_name_key UNIQUE (organization_id, name);
|
||||
@@ -0,0 +1,5 @@
|
||||
DROP INDEX idx_templates_name_lower;
|
||||
DROP INDEX templates_organization_id_name_idx;
|
||||
CREATE UNIQUE INDEX templates_organization_id_name_idx ON templates (organization_id, lower(name)) WHERE deleted = false;
|
||||
|
||||
ALTER TABLE ONLY templates DROP CONSTRAINT templates_organization_id_name_key;
|
||||
Reference in New Issue
Block a user