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);