Archive old migrations (#426)

* Archive old migrations

* Fix invalid placement of migrations
This commit is contained in:
Rikard Bartholf
2024-10-17 11:19:12 +02:00
committed by GitHub
parent 763262c108
commit ddcbd0afb0
500 changed files with 0 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
-- P5-6616: add locale_id column to collections_texts and populate it
ALTER TABLE collections_texts ADD column locale_id INTEGER;
ALTER TABLE collections_texts
add CONSTRAINT locale_fkey
FOREIGN KEY (locale_id)
REFERENCES locales(id) match SIMPLE;
UPDATE collections_texts SET locale_id = 1 where market_id = 1;
UPDATE collections_texts SET locale_id = 2 where market_id = 2;
UPDATE collections_texts SET locale_id = 3 where market_id = 3;
UPDATE collections_texts SET locale_id = 4 where market_id = 4;
UPDATE collections_texts SET locale_id = 5 where market_id = 5;
UPDATE collections_texts SET locale_id = 7 where market_id = 7;
UPDATE collections_texts SET locale_id = 8 where market_id = 8;
UPDATE collections_texts SET locale_id = 9 where market_id = 9;
UPDATE collections_texts SET locale_id = 10 where market_id = 10;
UPDATE collections_texts SET locale_id = 11 where market_id = 11;
UPDATE collections_texts SET locale_id = 12 where market_id = 12;
UPDATE collections_texts SET locale_id = 13 where market_id = 13;
UPDATE collections_texts SET locale_id = 14 where market_id = 14;
UPDATE collections_texts SET locale_id = 15 where market_id = 15;
ALTER TABLE collections_texts DROP column market_id;
ALTER TABLE collections_texts ALTER COLUMN locale_id SET NOT NULL;
ALTER TABLE collections_texts ADD CONSTRAINT unique_slug UNIQUE (locale_id, slug);