diff --git a/coderd/database/dump.sql b/coderd/database/dump.sql index 6cf8c0d4bf..a7c6394b34 100644 --- a/coderd/database/dump.sql +++ b/coderd/database/dump.sql @@ -632,6 +632,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_agents_resource_id_idx ON workspace_agents USING btree (resource_id); + 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); diff --git a/coderd/database/migrations/000078_workspace_agents_resource_id_idx.down.sql b/coderd/database/migrations/000078_workspace_agents_resource_id_idx.down.sql new file mode 100644 index 0000000000..b94373858a --- /dev/null +++ b/coderd/database/migrations/000078_workspace_agents_resource_id_idx.down.sql @@ -0,0 +1 @@ +DROP INDEX workspace_agents_resource_id_idx; diff --git a/coderd/database/migrations/000078_workspace_agents_resource_id_idx.up.sql b/coderd/database/migrations/000078_workspace_agents_resource_id_idx.up.sql new file mode 100644 index 0000000000..b5dbc2abfd --- /dev/null +++ b/coderd/database/migrations/000078_workspace_agents_resource_id_idx.up.sql @@ -0,0 +1 @@ +CREATE INDEX workspace_agents_resource_id_idx ON workspace_agents USING btree (resource_id);