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
+38
View File
@@ -0,0 +1,38 @@
CREATE TABLE IF NOT EXISTS categorydatakeys
(
id serial NOT NULL,
name character varying(255) NOT NULL,
CONSTRAINT categorydatakeys_pkey
PRIMARY KEY (id)
);
DROP INDEX IF EXISTS categorydatakeys_value_idx;
CREATE UNIQUE INDEX categorydatakeys_value_idx
ON categorydatakeys (name);
CREATE TABLE IF NOT EXISTS categorydata
(
category_id integer NOT NULL,
datakey_id integer NOT NULL,
locale_id integer NOT NULL,
text text NOT NULL,
CONSTRAINT categorydata_pkey
PRIMARY KEY (category_id, datakey_id, locale_id),
CONSTRAINT categorydata_category_id_fkey
FOREIGN KEY (category_id)
REFERENCES categories (id),
CONSTRAINT categorydata_datakey_id_fkey
FOREIGN KEY (datakey_id)
REFERENCES categorydatakeys (id),
CONSTRAINT categorydata_locale_id_fkey
FOREIGN KEY (locale_id)
REFERENCES locales (id)
);
INSERT INTO categorydatakeys (name)
VALUES ('canvas_pagetitle'),
('canvas_metadesc'),
('wallpaper_pagetitle'),
('wallpaper_metadesc'),
('design_wallpaper_pagetitle'),
('design_wallpaper_metadesc');