Skip to content

Commit 8e8a03a

Browse files
committed
Add foreign key constraint on collector_id
1 parent cb83551 commit 8e8a03a

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

database/src/pool/postgres.rs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -344,13 +344,18 @@ static MIGRATIONS: &[&str] = &[
344344
REFERENCES benchmark_request(tag)
345345
ON DELETE CASCADE,
346346
347-
CONSTRAINT job_queue_unique
348-
UNIQUE (
349-
request_tag,
350-
target,
351-
backend,
352-
profile,
353-
benchmark_set
347+
CONSTRAINT job_queue_collector
348+
FOREIGN KEY (collector_id)
349+
REFERENCES collector_config(id)
350+
ON DELETE CASCADE,
351+
352+
CONSTRAINT job_queue_unique
353+
UNIQUE (
354+
request_tag,
355+
target,
356+
backend,
357+
profile,
358+
benchmark_set
354359
)
355360
);
356361
CREATE INDEX IF NOT EXISTS job_queue_request_tag_idx ON job_queue (request_tag);

0 commit comments

Comments
 (0)