Skip to content

Commit 2a514d3

Browse files
committed
add unique constraint on job_queue
1 parent 8f1763d commit 2a514d3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

database/src/pool/postgres.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,9 @@ static MIGRATIONS: &[&str] = &[
342342
CONSTRAINT job_queue_request_fk
343343
FOREIGN KEY (request_tag)
344344
REFERENCES benchmark_request(tag)
345-
ON DELETE CASCADE
345+
ON DELETE CASCADE,
346+
347+
CONSTRAINT job_queue_unique UNIQUE(request_tag, target, backend, profile)
346348
);
347349
CREATE INDEX IF NOT EXISTS job_queue_request_tag_idx ON job_queue (request_tag);
348350
"#,

0 commit comments

Comments
 (0)