From 0c32209612cc1b8d1a36c70052cb99364d9fda79 Mon Sep 17 00:00:00 2001 From: Adriano Caloiaro Date: Sat, 2 Mar 2024 10:48:59 -0700 Subject: [PATCH] feat: Make fingerprint unique to each queue --- ...240302172413_make_fingerprints_unique_to_each_queue.down.sql | 0 ...20240302172413_make_fingerprints_unique_to_each_queue.up.sql | 2 ++ 2 files changed, 2 insertions(+) create mode 100644 backends/postgres/migrations/20240302172413_make_fingerprints_unique_to_each_queue.down.sql create mode 100644 backends/postgres/migrations/20240302172413_make_fingerprints_unique_to_each_queue.up.sql 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');