"""add revision model

Revision ID: c5b4350e073b
Revises: 7883d80258fb
Create Date: 2023-04-11 16:18:55.045882

"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = "c5b4350e073b"
down_revision = "7883d80258fb"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        "revision",
        sa.Column("id", sa.Integer(), nullable=False),
        sa.Column("created_at", sa.DateTime(timezone=True), nullable=False),
        sa.Column("updated_at", sa.DateTime(timezone=True), nullable=False),
        sa.Column("revision_id", sa.Integer(), nullable=False),
        sa.Column("diff_id", sa.Integer(), nullable=False),
        sa.Column("patch_bytes", sa.LargeBinary(), nullable=False),
        sa.Column(
            "patch_data", postgresql.JSONB(astext_type=sa.Text()), nullable=False
        ),
        sa.PrimaryKeyConstraint("id"),
        sa.UniqueConstraint("revision_id"),
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table("revision")
    # ### end Alembic commands ###
