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
+9
View File
@@ -0,0 +1,9 @@
-- Add a new column to the editorial_content table
ALTER TABLE editorial_content ADD COLUMN editorial_page_type editorial_type NOT NULL DEFAULT 'campaign';
-- Update all editorial_content rows to have the same editorial_page_type as their associated editorial_pages
UPDATE editorial_content ec SET editorial_page_type = ep.type FROM editorial_pages ep WHERE ec.editorial_page_id = ep.id;
-- We need to update the contraint and add the type to make the id unique since slug can be the same
ALTER TABLE editorial_content DROP CONSTRAINT editorial_content_unique_key;
ALTER TABLE editorial_content ADD CONSTRAINT editorial_content_unique_key UNIQUE (slug, market_locale_id, editorial_page_type);