Skip to content

Commit 0c042dc

Browse files
authored
fix: Remove duplicate index that blocked same name (coder#1118)
Multiple workspaces couldn't be created with the same names!
1 parent 23295f7 commit 0c042dc

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

coderd/database/dump.sql

+1-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/migrations/000003_workspaces.up.sql

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ CREATE TABLE workspaces (
1212
);
1313

1414
-- Enforces no active workspaces have the same name.
15-
CREATE UNIQUE INDEX ON workspaces USING btree (owner_id, name) WHERE deleted = FALSE;
16-
CREATE UNIQUE INDEX idx_workspaces_name_lower ON workspaces USING btree (lower(name));
15+
CREATE UNIQUE INDEX ON workspaces USING btree (owner_id, lower(name)) WHERE deleted = FALSE;
1716

1817
CREATE TYPE workspace_transition AS ENUM (
1918
'start',

0 commit comments

Comments
 (0)