Skip to content

Commit a094fa3

Browse files
committed
Pr Feedback; create index on status-target-benchmark_set
1 parent a4c2ddc commit a094fa3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

database/src/pool/postgres.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,13 +368,14 @@ static MIGRATIONS: &[&str] = &[
368368
// to use as we do not expose the `collector_id` in the code
369369
r#"
370370
ALTER TABLE job_queue DROP CONSTRAINT IF EXISTS job_queue_collector;
371-
ALTER TABLE job_queue ADD COLUMN collector_name TEXT;
371+
ALTER TABLE job_queue ADD COLUMN IF NOT EXISTS collector_name TEXT;
372372
ALTER TABLE job_queue
373373
ADD CONSTRAINT job_queue_collector
374374
FOREIGN KEY (collector_name)
375375
REFERENCES collector_config(name)
376376
ON DELETE CASCADE;
377-
ALTER TABLE job_queue DROP COLUMN collector_id;
377+
ALTER TABLE job_queue DROP COLUMN IF EXISTS collector_id;
378+
CREATE INDEX IF NOT EXISTS job_queue_status_target_benchmark_set_idx ON job_queue (status, target, benchmark_set);
378379
"#,
379380
];
380381

0 commit comments

Comments
 (0)