Skip to content

Commit b1f6ec6

Browse files
committed
fix: Allow template names to be re-used after deletion
Fixes #2152
1 parent 6c2fc74 commit b1f6ec6

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

coderd/database/dump.sql

Lines changed: 1 addition & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
DROP INDEX idx_templates_name_lower;
2+
CREATE UNIQUE INDEX idx_templates_name_lower ON templates USING btree (lower(name));
3+
4+
ALTER TABLE ONLY templates ADD CONSTRAINT templates_organization_id_name_key UNIQUE (organization_id, name);
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
DROP INDEX idx_templates_name_lower;
2+
CREATE UNIQUE INDEX idx_templates_name_lower ON templates USING btree (lower(name)) WHERE deleted = false;
3+
4+
ALTER TABLE ONLY templates DROP CONSTRAINT templates_organization_id_name_key;

0 commit comments

Comments
 (0)