"""job_status_constraints

Revision ID: 87d17514eeed
Revises: 2701ef6ccb69
Create Date: 2016-05-02 12:46:02.230844

"""

# revision identifiers, used by Alembic.
revision = '87d17514eeed'
down_revision = '2701ef6ccb69'
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_error_data():
    ### commands auto generated by Alembic - please adjust! ###
    pass
    ### end Alembic commands ###


def downgrade_error_data():
    ### commands auto generated by Alembic - please adjust! ###
    pass
    ### end Alembic commands ###


def upgrade_job_tracker():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(u'job_status_submission_id_fkey', 'job_status', type_='foreignkey')
    op.create_foreign_key(None, 'job_status', 'submission', ['submission_id'], ['submission_id'], ondelete='CASCADE')
    ### end Alembic commands ###


def downgrade_job_tracker():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'job_status', type_='foreignkey')
    op.create_foreign_key(u'job_status_submission_id_fkey', 'job_status', 'submission', ['submission_id'], ['submission_id'])
    ### end Alembic commands ###


def upgrade_user_manager():
    ### commands auto generated by Alembic - please adjust! ###
    pass
    ### end Alembic commands ###


def downgrade_user_manager():
    ### commands auto generated by Alembic - please adjust! ###
    pass
    ### end Alembic commands ###


def upgrade_validation():
    ### commands auto generated by Alembic - please adjust! ###
    pass
    ### end Alembic commands ###


def downgrade_validation():
    ### commands auto generated by Alembic - please adjust! ###
    pass
    ### end Alembic commands ###


add missing job_status constraints to db migrations