""" Adding upper indexes to B/C uniqueness columns

Revision ID: 0172b4703e8c
Revises: 1ddbc8a39215
Create Date: 2021-08-13 14:06:33.089082

"""

# revision identifiers, used by Alembic.
revision = '0172b4703e8c'
down_revision = '1ddbc8a39215'
branch_labels = None
depends_on = None

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

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! ###
    # ### end Alembic commands ###
    op.create_index('ix_oc_atc_upper', 'object_class_program_activity', [sa.text('UPPER(availability_type_code)')], unique=False)
    op.create_index('ix_oc_dr_upper', 'object_class_program_activity', [sa.text('UPPER(by_direct_reimbursable_fun)')], unique=False)
    op.create_index('ix_af_atc_upper', 'award_financial', [sa.text('UPPER(availability_type_code)')], unique=False)
    op.create_index('ix_af_dr_upper', 'award_financial', [sa.text('UPPER(by_direct_reimbursable_fun)')], unique=False)

def downgrade_data_broker():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index('ix_oc_atc_upper', table_name='object_class_program_activity')
    op.drop_index('ix_oc_dr_upper', table_name='object_class_program_activity')
    op.drop_index('ix_af_atc_upper', table_name='award_financial')
    op.drop_index('ix_af_dr_upper', table_name='award_financial')
    # ### end Alembic commands ###

