From fa15810dbbd5068bd60ea940e612710924f6816a Mon Sep 17 00:00:00 2001 From: vikingowl Date: Sat, 18 Apr 2026 07:17:21 +0200 Subject: [PATCH] feat(discovery): add rejected_discoveries sticky-reject table migration --- .../migrations/000013_rejected_discoveries.down.sql | 1 + .../migrations/000013_rejected_discoveries.up.sql | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 backend/migrations/000013_rejected_discoveries.down.sql create mode 100644 backend/migrations/000013_rejected_discoveries.up.sql diff --git a/backend/migrations/000013_rejected_discoveries.down.sql b/backend/migrations/000013_rejected_discoveries.down.sql new file mode 100644 index 0000000..6f6e210 --- /dev/null +++ b/backend/migrations/000013_rejected_discoveries.down.sql @@ -0,0 +1 @@ +DROP TABLE IF EXISTS rejected_discoveries; diff --git a/backend/migrations/000013_rejected_discoveries.up.sql b/backend/migrations/000013_rejected_discoveries.up.sql new file mode 100644 index 0000000..47fb1b8 --- /dev/null +++ b/backend/migrations/000013_rejected_discoveries.up.sql @@ -0,0 +1,13 @@ +CREATE TABLE rejected_discoveries ( + id uuid PRIMARY KEY DEFAULT gen_random_uuid(), + name_normalized text NOT NULL, + stadt text NOT NULL, + year int NOT NULL, + rejected_at timestamptz NOT NULL DEFAULT now(), + rejected_by uuid REFERENCES users(id) ON DELETE SET NULL, + reason text, + UNIQUE (name_normalized, stadt, year) +); + +CREATE INDEX idx_rejected_discoveries_lookup + ON rejected_discoveries (name_normalized, stadt, year);