Skip to content

Commit 1fa6489

Browse files
committed
fix: Consolidate idx_templates_name_lower and templates_organization_id_name_idx
1 parent 5555ddb commit 1fa6489

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
DROP INDEX idx_templates_name_lower;
1+
DROP INDEX templates_organization_id_name_idx;
2+
CREATE UNIQUE INDEX templates_organization_id_name_idx ON templates USING btree (organization_id, name) WHERE deleted = false;
23
CREATE UNIQUE INDEX idx_templates_name_lower ON templates USING btree (lower(name));
34

45
ALTER TABLE ONLY templates ADD CONSTRAINT templates_organization_id_name_key UNIQUE (organization_id, name);
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
DROP INDEX idx_templates_name_lower;
2-
CREATE UNIQUE INDEX idx_templates_name_lower ON templates USING btree (lower(name)) WHERE deleted = false;
2+
DROP INDEX templates_organization_id_name_idx;
3+
CREATE UNIQUE INDEX templates_organization_id_name_idx ON templates (organization_id, lower(name)) WHERE deleted = false;
34

45
ALTER TABLE ONLY templates DROP CONSTRAINT templates_organization_id_name_key;

0 commit comments

Comments
 (0)