"""Add multi-column indexes to appropriation and object class program activity table

Revision ID: 51b1bbc0bfde
Revises: 4ebc7a781b31
Create Date: 2019-07-26 12:03:39.154057

"""

# revision identifiers, used by Alembic.
revision = '51b1bbc0bfde'
down_revision = '4ebc7a781b31'
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! ###
    op.create_index('ix_appropriation_tas_id_submission_id', 'appropriation', ['tas_id', 'submission_id'], unique=False)
    op.create_index('ix_oc_pa_tas_id_submission_id', 'object_class_program_activity', ['tas_id', 'submission_id'], unique=False)
    # ### end Alembic commands ###


def downgrade_data_broker():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index('ix_oc_pa_tas_id_submission_id', table_name='object_class_program_activity')
    op.drop_index('ix_appropriation_tas_id_submission_id', table_name='appropriation')
    # ### end Alembic commands ###

