"""create contests table

Revision ID: 3c048b333190
Revises: 79f24a06e40e
Create Date: 2021-10-01 11:53:01.948179

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '3c048b333190'
down_revision = '79f24a06e40e'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('contests',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('contest_id', sa.String(length=255), nullable=False),
    sa.Column('office_id', sa.String(length=255), nullable=True),
    sa.Column('results_group', sa.String(length=255), nullable=True),
    sa.Column('office_name', sa.String(length=255), nullable=True),
    sa.Column('district_code', sa.String(length=255), nullable=True),
    sa.Column('state', sa.String(length=255), nullable=True),
    sa.Column('county_id', sa.String(length=255), nullable=True),
    sa.Column('precinct_id', sa.String(length=255), nullable=True),
    sa.Column('precincts_reporting', sa.BigInteger(), nullable=True),
    sa.Column('total_effected_precincts', sa.BigInteger(), nullable=True),
    sa.Column('total_votes_for_office', sa.BigInteger(), nullable=True),
    sa.Column('seats', sa.BigInteger(), nullable=True),
    sa.Column('ranked_choice', sa.Boolean(), nullable=True),
    sa.Column('primary', sa.Boolean(), nullable=True),
    sa.Column('scope', sa.String(length=255), nullable=True),
    sa.Column('title', sa.String(length=255), nullable=True),
    sa.Column('boundary', sa.String(length=255), nullable=True),
    sa.Column('partisan', sa.Boolean(), nullable=True),
    sa.Column('question_body', sa.Text(), nullable=True),
    sa.Column('sub_title', sa.String(length=255), nullable=True),
    sa.Column('incumbent_party', sa.String(length=255), nullable=True),
    sa.Column('called', sa.Boolean(), nullable=True),
    sa.Column('updated', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('contest_id')
    )
    # ### end Alembic commands ###


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