"""Adding census_year to state_congressional_table

Revision ID: 5456e2207d32
Revises: 17105e26eef4
Create Date: 2018-05-03 12:20:05.945295

"""

# revision identifiers, used by Alembic.
revision = '5456e2207d32'
down_revision = '17105e26eef4'
branch_labels = None
depends_on = None

from alembic import op
import sqlalchemy as sa


def upgrade(engine_name):
    globals()["upgrade_%s" % engine_name]()


def downgrade(engine_name):
    globals()["downgrade_%s" % engine_name]()





def upgrade_data_broker():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('state_congressional', sa.Column('census_year', sa.Integer(), nullable=True))
    op.create_index(op.f('ix_state_congressional_census_year'), 'state_congressional', ['census_year'], unique=False)
    # ### end Alembic commands ###


def downgrade_data_broker():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_state_congressional_census_year'), table_name='state_congressional')
    op.drop_column('state_congressional', 'census_year')
    # ### end Alembic commands ###

