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

Revision ID: aa3978570981
Revises: a3004ca81e25
Create Date: 2020-09-02 00:09:27.390165+00:00

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "aa3978570981"
down_revision = "a3004ca81e25"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        "batch_result",
        sa.Column("created_at", sa.DateTime(), nullable=False),
        sa.Column("updated_at", sa.DateTime(), nullable=False),
        sa.Column("batch_id", sa.String(length=200), nullable=False),
        sa.Column("contest_choice_id", sa.String(length=200), nullable=False),
        sa.Column("result", sa.Integer(), nullable=False),
        sa.ForeignKeyConstraint(
            ["batch_id"],
            ["batch.id"],
            name=op.f("batch_result_batch_id_fkey"),
            ondelete="cascade",
        ),
        sa.ForeignKeyConstraint(
            ["contest_choice_id"],
            ["contest_choice.id"],
            name=op.f("batch_result_contest_choice_id_fkey"),
            ondelete="cascade",
        ),
        sa.PrimaryKeyConstraint(
            "batch_id", "contest_choice_id", name=op.f("batch_result_pkey")
        ),
    )
    # ### end Alembic commands ###


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