"""Rename fiscal_year_quarter in program_activity to fiscal_year_period

Revision ID: 24331fcfcd00
Revises: 471273c020c5
Create Date: 2020-06-05 07:38:03.259036

"""

# revision identifiers, used by Alembic.
revision = '24331fcfcd00'
down_revision = '471273c020c5'
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_program_activity_fiscal_year_quarter', table_name='program_activity')
    op.execute('ALTER TABLE program_activity RENAME COLUMN fiscal_year_quarter TO fiscal_year_period')
    op.create_index(op.f('ix_program_activity_fiscal_year_period'), 'program_activity', ['fiscal_year_period'], unique=False)
    # ### end Alembic commands ###


def downgrade_data_broker():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index('ix_program_activity_fiscal_year_period', table_name='program_activity')
    op.execute('ALTER TABLE program_activity RENAME COLUMN fiscal_year_period TO fiscal_year_quarter')
    op.create_index('ix_program_activity_fiscal_year_quarter', 'program_activity', ['fiscal_year_quarter'], unique=False)
    # ### end Alembic commands ###

