"""Add multicolumn upper indexes to published_award_financial_assistance

Revision ID: be4dcb9eede6
Revises: 6e3be68b87ae
Create Date: 2020-07-30 14:41:38.848315

"""

# revision identifiers, used by Alembic.
revision = 'be4dcb9eede6'
down_revision = '6e3be68b87ae'
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.execute('CREATE INDEX ix_pafa_fain_awarding_subtier_upper ON published_award_financial_assistance (UPPER(fain), UPPER(awarding_sub_tier_agency_c));')
    op.execute('CREATE INDEX ix_pafa_uri_awarding_subtier_upper ON published_award_financial_assistance (UPPER(uri), UPPER(awarding_sub_tier_agency_c));')
    # ### end Alembic commands ###


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

