diff --git a/coderd/database/dump.sql b/coderd/database/dump.sql index 2b369cf167fe3..dfaf8e0451a4a 100644 --- a/coderd/database/dump.sql +++ b/coderd/database/dump.sql @@ -624,6 +624,8 @@ CREATE UNIQUE INDEX users_email_lower_idx ON users USING btree (lower(email)) WH CREATE UNIQUE INDEX users_username_lower_idx ON users USING btree (lower(username)) WHERE (deleted = false); +CREATE INDEX workspace_resources_job_id_idx ON workspace_resources USING btree (job_id); + CREATE UNIQUE INDEX workspaces_owner_id_lower_idx ON workspaces USING btree (owner_id, lower((name)::text)) WHERE (deleted = false); ALTER TABLE ONLY api_keys diff --git a/coderd/database/migrations/000074_workspace_resources_job_id_idx.down.sql b/coderd/database/migrations/000074_workspace_resources_job_id_idx.down.sql new file mode 100644 index 0000000000000..1382a80feb2de --- /dev/null +++ b/coderd/database/migrations/000074_workspace_resources_job_id_idx.down.sql @@ -0,0 +1 @@ +DROP INDEX workspace_resources_job_id_idx; diff --git a/coderd/database/migrations/000074_workspace_resources_job_id_idx.up.sql b/coderd/database/migrations/000074_workspace_resources_job_id_idx.up.sql new file mode 100644 index 0000000000000..29bd6798b4750 --- /dev/null +++ b/coderd/database/migrations/000074_workspace_resources_job_id_idx.up.sql @@ -0,0 +1 @@ +CREATE INDEX CONCURRENTLY workspace_resources_job_id_idx ON workspace_resources USING btree (job_id);