kemono2/db/migrations/20210614_01_YW8Os-add-comment-tables.py
2024-07-04 21:57:05 +02:00

26 lines
659 B
Python

"""
Add comment tables
"""
from yoyo import step
__depends__ = {"20210611_01_jpGYN-add-update-index"}
steps = [
step(
"""
CREATE TABLE IF NOT EXISTS comments (
"id" varchar(255) NOT NULL,
"post_id" varchar(255) NOT NULL,
"parent_id" varchar(255),
"commenter" varchar(255) NOT NULL,
"service" varchar(20) NOT NULL,
"content" text NOT NULL DEFAULT '',
"added" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
"published" timestamp,
PRIMARY KEY (id, service)
);
"""
)
]