# pylint: disable=invalid-name
"""Batch tallies file

Revision ID: 11e35dd1c515
Revises: 9ed660c31c0a
Create Date: 2020-08-13 19:39:17.333582+00:00

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "11e35dd1c515"
down_revision = "9ed660c31c0a"
branch_labels = None
depends_on = None


def upgrade():
    op.add_column("jurisdiction", sa.Column("batch_tallies", sa.JSON(), nullable=True))
    op.add_column(
        "jurisdiction",
        sa.Column("batch_tallies_file_id", sa.String(length=200), nullable=True),
    )
    op.create_foreign_key(
        op.f("jurisdiction_batch_tallies_file_id_fkey"),
        "jurisdiction",
        "file",
        ["batch_tallies_file_id"],
        ["id"],
        ondelete="set null",
    )


def downgrade():  # pragma: no cover
    pass
    # ### commands auto generated by Alembic - please adjust! ###
    # op.drop_constraint(op.f('jurisdiction_batch_tallies_file_id_fkey'), 'jurisdiction', type_='foreignkey')
    # op.drop_column('jurisdiction', 'batch_tallies_file_id')
    # op.drop_column('jurisdiction', 'batch_tallies')
    # ### end Alembic commands ###
