"""cascade Job deletion to FileRequest

Revision ID: 0974293b64c3
Revises: 03257ae6000f
Create Date: 2017-12-05 13:32:43.109949

"""

# revision identifiers, used by Alembic.
revision = '0974293b64c3'
down_revision = '03257ae6000f'
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_file_request_job_id', 'file_request', type_='foreignkey')
    op.create_foreign_key('fk_file_request_job_id', 'file_request', 'job', ['job_id'], ['job_id'], ondelete='CASCADE')
    ### end Alembic commands ###


def downgrade_data_broker():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint('fk_file_request_job_id', 'file_request', type_='foreignkey')
    op.create_foreign_key('fk_file_request_job_id', 'file_request', 'job', ['job_id'], ['job_id'])
    ### end Alembic commands ###

