"""Index upper afa_generated_unique in detached and published tables

Revision ID: 15e6fb2c4e8d
Revises: e36714e8e2d8
Create Date: 2019-06-06 10:41:44.052085

"""

# revision identifiers, used by Alembic.
revision = '15e6fb2c4e8d'
down_revision = '5fa1aa9c3f81'
branch_labels = None
depends_on = None

from alembic import op
from sqlalchemy import text


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.create_index('ix_pafa_afa_generated_unique_upper', 'published_award_financial_assistance', [text('UPPER(afa_generated_unique)')], unique=False)
    op.create_index('ix_dafa_afa_generated_unique_upper', 'detached_award_financial_assistance', [text('UPPER(afa_generated_unique)')], unique=False)
    # ### end Alembic commands ###


def downgrade_data_broker():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index('ix_dafa_afa_generated_unique_upper', table_name='published_award_financial_assistance')
    op.drop_index('ix_pafa_afa_generated_unique_upper', table_name='detached_award_financial_assistance')
    # ### end Alembic commands ###

