diff --git a/backends/postgres/migrations/20240302172413_make_fingerprints_unique_to_each_queue.down.sql b/backends/postgres/migrations/20240302172413_make_fingerprints_unique_to_each_queue.down.sql new file mode 100644 index 0000000..e69de29 diff --git a/backends/postgres/migrations/20240302172413_make_fingerprints_unique_to_each_queue.up.sql b/backends/postgres/migrations/20240302172413_make_fingerprints_unique_to_each_queue.up.sql new file mode 100644 index 0000000..f37787f --- /dev/null +++ b/backends/postgres/migrations/20240302172413_make_fingerprints_unique_to_each_queue.up.sql @@ -0,0 +1,2 @@ +DROP INDEX IF EXISTS neoq_jobs_fingerprint_unique_idx; +CREATE UNIQUE INDEX IF NOT EXISTS neoq_jobs_fingerprint_unique_idx ON neoq_jobs (queue, fingerprint, status) WHERE NOT (status = 'processed');