"""Updating several IDs to be BigInts

Revision ID: 48fbbea5de34
Revises: fb76b653c99d
Create Date: 2023-05-08 11:05:18.361986

"""

# revision identifiers, used by Alembic.
revision = '48fbbea5de34'
down_revision = 'fb76b653c99d'
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.alter_column('award_financial_assistance', 'award_financial_assistance_id',
               existing_type=sa.INTEGER(),
               type_=sa.BigInteger())
    op.alter_column('award_procurement', 'award_procurement_id',
               existing_type=sa.INTEGER(),
               type_=sa.BigInteger())
    op.alter_column('detached_award_procurement', 'detached_award_procurement_id',
               existing_type=sa.INTEGER(),
               type_=sa.BigInteger())
    op.alter_column('fabs', 'fabs_id',
               existing_type=sa.INTEGER(),
               type_=sa.BigInteger())
    op.alter_column('flex_field', 'flex_field_id',
               existing_type=sa.INTEGER(),
               type_=sa.BigInteger())
    op.alter_column('object_class_program_activity', 'object_class_program_activity_id',
               existing_type=sa.INTEGER(),
               type_=sa.BigInteger())
    op.alter_column('published_award_financial_assistance', 'published_award_financial_assistance_id',
               existing_type=sa.INTEGER(),
               type_=sa.BigInteger())
    op.alter_column('published_award_procurement', 'published_award_procurement_id',
               existing_type=sa.INTEGER(),
               type_=sa.BigInteger())
    op.alter_column('published_fabs', 'published_fabs_id',
               existing_type=sa.INTEGER(),
               type_=sa.BigInteger())
    op.alter_column('published_flex_field', 'published_flex_field_id',
               existing_type=sa.INTEGER(),
               type_=sa.BigInteger())
    op.alter_column('published_object_class_program_activity', 'published_object_class_program_activity_id',
               existing_type=sa.INTEGER(),
               type_=sa.BigInteger())
    op.alter_column('sf_133', 'sf133_id',
               existing_type=sa.INTEGER(),
               type_=sa.BigInteger())
    op.alter_column('subaward', 'id',
               existing_type=sa.INTEGER(),
               type_=sa.BigInteger())
    # ### end Alembic commands ###


def downgrade_data_broker():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('subaward', 'id',
               existing_type=sa.BigInteger(),
               type_=sa.INTEGER())
    op.alter_column('sf_133', 'sf133_id',
               existing_type=sa.BigInteger(),
               type_=sa.INTEGER())
    op.alter_column('published_object_class_program_activity', 'published_object_class_program_activity_id',
               existing_type=sa.BigInteger(),
               type_=sa.INTEGER())
    op.alter_column('published_flex_field', 'published_flex_field_id',
               existing_type=sa.BigInteger(),
               type_=sa.INTEGER())
    op.alter_column('published_fabs', 'published_fabs_id',
               existing_type=sa.BigInteger(),
               type_=sa.INTEGER())
    op.alter_column('published_award_procurement', 'published_award_procurement_id',
               existing_type=sa.BigInteger(),
               type_=sa.INTEGER())
    op.alter_column('published_award_financial_assistance', 'published_award_financial_assistance_id',
               existing_type=sa.BigInteger(),
               type_=sa.INTEGER())
    op.alter_column('object_class_program_activity', 'object_class_program_activity_id',
               existing_type=sa.BigInteger(),
               type_=sa.INTEGER())
    op.alter_column('flex_field', 'flex_field_id',
               existing_type=sa.BigInteger(),
               type_=sa.INTEGER())
    op.alter_column('fabs', 'fabs_id',
               existing_type=sa.BigInteger(),
               type_=sa.INTEGER())
    op.alter_column('detached_award_procurement', 'detached_award_procurement_id',
               existing_type=sa.BigInteger(),
               type_=sa.INTEGER())
    op.alter_column('award_procurement', 'award_procurement_id',
               existing_type=sa.BigInteger(),
               type_=sa.INTEGER())
    op.alter_column('award_financial_assistance', 'award_financial_assistance_id',
               existing_type=sa.BigInteger(),
               type_=sa.INTEGER())
    # ### end Alembic commands ###

