"""add_error_table_fks

Revision ID: 0c857b50962a
Revises: 51679e7bfe01
Create Date: 2016-09-26 21:42:17.896556

"""

# revision identifiers, used by Alembic.
revision = '0c857b50962a'
down_revision = '51679e7bfe01'
branch_labels = None
depends_on = None

from alembic import op


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_foreign_key('fk_target_file_type_file_status_id', 'error_metadata', 'file_type', ['target_file_type_id'], ['file_type_id'])
    op.create_foreign_key('fk_error_severity_id', 'error_metadata', 'rule_severity', ['severity_id'], ['rule_severity_id'])
    op.create_foreign_key('fk_file_type_file_status_id', 'error_metadata', 'file_type', ['file_type_id'], ['file_type_id'])
    ### end Alembic commands ###


def downgrade_data_broker():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint('fk_file_type_file_status_id', 'error_metadata', type_='foreignkey')
    op.drop_constraint('fk_error_severity_id', 'error_metadata', type_='foreignkey')
    op.drop_constraint('fk_target_file_type_file_status_id', 'error_metadata', type_='foreignkey')
    ### end Alembic commands ###

