"""
Add comments revisions
"""

from yoyo import step

__depends__ = {"20231111_00_DEL88D-add-tags-to-posts"}

steps = [
    step(
        """
        CREATE TABLE public.comments_revisions (
            revision_id serial4 NOT NULL,
            id varchar(255) NOT NULL,
            post_id varchar(255) NOT NULL,
            parent_id varchar(255) NULL,
            commenter varchar(255) NOT NULL,
            service varchar(20) NOT NULL,
            "content" text NOT NULL DEFAULT ''::text,
            added timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
            published timestamp NULL,
            CONSTRAINT comments_revisions_pkey PRIMARY KEY (revision_id)
        );
        CREATE INDEX comments_revisions_post_id_idx ON public.comments_revisions USING btree (post_id);
        CREATE INDEX comments_revisions_id_idx ON public.comments_revisions USING btree (id);
        """
    ),
]
