kemono2/db/migrations/20210707_03_m9nL9-add-temp-dm-tables.py
2024-07-04 21:57:05 +02:00

28 lines
682 B
Python

"""
Add temp DM tables
"""
from yoyo import step
__depends__ = {"20210707_02_flWka-add-dm-tables"}
steps = [
step(
"""
CREATE TABLE unapproved_dms (
"import_id" varchar(255) NOT NULL,
"id" varchar(255) NOT NULL,
"user" varchar(255) NOT NULL,
"service" varchar(20) NOT NULL,
"content" text NOT NULL DEFAULT '',
"embed" jsonb NOT NULL DEFAULT '{}',
"added" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
"published" timestamp,
"file" jsonb NOT NULL,
PRIMARY KEY (id, service)
);
""",
"DROP TABLE unapproved_dms",
),
]