# pylint: disable=invalid-name
"""BatchResultsFinalized

Revision ID: 30f47ec7308c
Revises: 2aeb618b9438
Create Date: 2021-10-28 20:55:31.197355+00:00

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "30f47ec7308c"
down_revision = "2aeb618b9438"
branch_labels = None
depends_on = None


def upgrade():
    op.create_table(
        "batch_results_finalized",
        sa.Column("created_at", sa.DateTime(), nullable=False),
        sa.Column("updated_at", sa.DateTime(), nullable=False),
        sa.Column("jurisdiction_id", sa.String(length=200), nullable=False),
        sa.Column("round_id", sa.String(length=200), nullable=False),
        sa.ForeignKeyConstraint(
            ["jurisdiction_id"],
            ["jurisdiction.id"],
            name=op.f("batch_results_finalized_jurisdiction_id_fkey"),
            ondelete="cascade",
        ),
        sa.ForeignKeyConstraint(
            ["round_id"],
            ["round.id"],
            name=op.f("batch_results_finalized_round_id_fkey"),
            ondelete="cascade",
        ),
        sa.PrimaryKeyConstraint(
            "jurisdiction_id", "round_id", name=op.f("batch_results_finalized_pkey")
        ),
    )


def downgrade():  # pragma: no cover
    pass
    # ### commands auto generated by Alembic - please adjust! ###
    # op.drop_table("batch_results_finalized")
    # ### end Alembic commands ###
