"""remove columns from file_generation_task

Revision ID: 23f213c103cf
Revises: 9f7136e38e21
Create Date: 2016-12-06 11:56:10.522559

"""

# revision identifiers, used by Alembic.
revision = '23f213c103cf'
down_revision = '9f7136e38e21'
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_constraint('fk_generation_submission', 'file_generation_task', type_='foreignkey')
    op.drop_constraint('fk_generation_file_type', 'file_generation_task', type_='foreignkey')
    op.drop_column('file_generation_task', 'file_type_id')
    op.drop_column('file_generation_task', 'submission_id')
    ### end Alembic commands ###


def downgrade_data_broker():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('file_generation_task', sa.Column('submission_id', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('file_generation_task', sa.Column('file_type_id', sa.INTEGER(), autoincrement=False, nullable=True))
    op.create_foreign_key('fk_generation_file_type', 'file_generation_task', 'file_type', ['file_type_id'], ['file_type_id'])
    op.create_foreign_key('fk_generation_submission', 'file_generation_task', 'submission', ['submission_id'], ['submission_id'])
    ### end Alembic commands ###

