"""Create tas_failed_edits table

Revision ID: 5cb2560ae8e6
Revises: f6b781754131
Create Date: 2022-06-21 13:37:35.044045

"""

# revision identifiers, used by Alembic.
revision = '5cb2560ae8e6'
down_revision = 'f6b781754131'
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.create_table('tas_failed_edits',
        sa.Column('created_at', sa.DateTime(), nullable=True),
        sa.Column('updated_at', sa.DateTime(), nullable=True),
        sa.Column('tas_failed_edits_id', sa.Integer(), nullable=False),
        sa.Column('agency_identifier', sa.Text(), nullable=True),
        sa.Column('allocation_transfer_agency', sa.Text(), nullable=True),
        sa.Column('availability_type_code', sa.Text(), nullable=True),
        sa.Column('beginning_period_of_availa', sa.Text(), nullable=True),
        sa.Column('ending_period_of_availabil', sa.Text(), nullable=True),
        sa.Column('main_account_code', sa.Text(), nullable=True),
        sa.Column('sub_account_code', sa.Text(), nullable=True),
        sa.Column('tas', sa.Text(), nullable=False),
        sa.Column('display_tas', sa.Text(), nullable=False),
        sa.Column('fiscal_year', sa.Integer(), nullable=False),
        sa.Column('period', sa.Integer(), nullable=False),
        sa.Column('fr_entity_type', sa.Text(), nullable=True),
        sa.Column('fr_entity_description', sa.Text(), nullable=True),
        sa.Column('edit_number', sa.Text(), nullable=True),
        sa.Column('edit_id', sa.Text(), nullable=True),
        sa.Column('severity', sa.Text(), nullable=True),
        sa.Column('atb_submission_status', sa.Text(), nullable=True),
        sa.Column('approved_override_exists', sa.Boolean(), nullable=True),
        sa.PrimaryKeyConstraint('tas_failed_edits_id')
    )
    op.create_index(op.f('ix_tas_failed_edits_display_tas'), 'tas_failed_edits', ['display_tas'], unique=False)
    op.create_index(op.f('ix_tas_failed_edits_fiscal_year'), 'tas_failed_edits', ['fiscal_year'], unique=False)
    op.create_index(op.f('ix_tas_failed_edits_period'), 'tas_failed_edits', ['period'], unique=False)
    op.create_index(op.f('ix_tas_failed_edits_tas'), 'tas_failed_edits', ['tas'], unique=False)
    # ### end Alembic commands ###


def downgrade_data_broker():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_tas_failed_edits_tas'), table_name='tas_failed_edits')
    op.drop_index(op.f('ix_tas_failed_edits_period'), table_name='tas_failed_edits')
    op.drop_index(op.f('ix_tas_failed_edits_fiscal_year'), table_name='tas_failed_edits')
    op.drop_index(op.f('ix_tas_failed_edits_display_tas'), table_name='tas_failed_edits')
    op.drop_table('tas_failed_edits')
    # ### end Alembic commands ###

