kemono2/db/migrations/20230517_00_Nt351-add-complete-imports-table.py
2024-07-04 21:57:05 +02:00

23 lines
580 B
Python

"""
Add table complete_imports
"""
from yoyo import step
__depends__ = {"20230507_00_d10V9-add-service-to-post-incomplete-rewards"}
steps = [
step(
"""
CREATE TABLE complete_imports (
user_id varchar(255) NOT NULL,
service varchar(20) NOT NULL,
subscription varchar(255) NOT NULL,
last_successful_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
info jsonb NOT NULL DEFAULT '{}'::jsonb,
CONSTRAINT complete_imports_pkey PRIMARY KEY (user_id, service, subscription)
);
"""
),
]