"""Add unique constraint to program_number in cfda_program table

Revision ID: 67feaf4d50b8
Revises: a9b778fd5181
Create Date: 2018-08-30 09:59:18.532654

"""

# revision identifiers, used by Alembic.
revision = '67feaf4d50b8'
down_revision = 'a9b778fd5181'
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.drop_index('ix_cfda_program_program_number', table_name='cfda_program')
    op.create_index(op.f('ix_cfda_program_program_number'), 'cfda_program', ['program_number'], unique=True)
    # ### end Alembic commands ###


def downgrade_data_broker():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_cfda_program_program_number'), table_name='cfda_program')
    op.create_index('ix_cfda_program_program_number', 'cfda_program', ['program_number'], unique=False)
    # ### end Alembic commands ###

