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
+11
View File
@@ -0,0 +1,11 @@
-- P5-1677 3b Make sure the canonical settings on categories in admin works and implement the backend logic
-- Adding primary key
ALTER TABLE category_metadata ADD PRIMARY KEY (category_id);
ALTER TABLE category_metadata
ALTER COLUMN canonical DROP DEFAULT,
ALTER COLUMN canonical TYPE integer USING (CASE WHEN canonical = '' THEN NULL ELSE canonical::integer END),
ADD CONSTRAINT categories_category_metadata_canonical_fk FOREIGN KEY (canonical)
REFERENCES public.categories (id)
ON UPDATE CASCADE ON DELETE SET NULL;