Skip to content

Commit dec3d6c

Browse files
chore: add index to template_id on workspaces
1 parent df74e6f commit dec3d6c

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

coderd/database/dump.sql

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/migrations/000278_workspace_next_start_at.down.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ DROP FUNCTION IF EXISTS nullify_next_start_at_on_template_autostart_modification
66
DROP TRIGGER IF EXISTS trigger_nullify_next_start_at_on_workspace_autostart_modification ON workspaces;
77
DROP FUNCTION IF EXISTS nullify_next_start_at_on_workspace_autostart_modification;
88

9+
DROP INDEX workspace_template_id_idx;
910
DROP INDEX workspace_next_start_at_idx;
1011

1112
ALTER TABLE ONLY workspaces DROP COLUMN IF EXISTS next_start_at;

coderd/database/migrations/000278_workspace_next_start_at.up.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
ALTER TABLE ONLY workspaces ADD COLUMN IF NOT EXISTS next_start_at TIMESTAMPTZ DEFAULT NULL;
22

33
CREATE INDEX workspace_next_start_at_idx ON workspaces USING btree (next_start_at) WHERE (deleted=false);
4+
CREATE INDEX workspace_template_id_idx ON workspaces USING btree (template_id) WHERE (deleted=false);
45

56
CREATE FUNCTION nullify_next_start_at_on_workspace_autostart_modification() RETURNS trigger
67
LANGUAGE plpgsql

0 commit comments

Comments
 (0)