"""Allow for Spring and Intro eval relationships

Revision ID: 5615d58892a1
Revises: 6f6b843e2b8f
Create Date: 2017-04-27 15:40:40.640402

"""

# revision identifiers, used by Alembic.
revision = '5615d58892a1'
down_revision = '6f6b843e2b8f'

from alembic import op
import sqlalchemy as sa


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('conditional', sa.Column('i_evaluation', sa.Integer(), nullable=True))
    op.add_column('conditional', sa.Column('s_evaluation', sa.Integer(), nullable=True))
    op.drop_constraint('conditional_evaluation_fkey', 'conditional', type_='foreignkey')
    op.create_foreign_key(None, 'conditional', 'spring_evals', ['s_evaluation'], ['id'])
    op.create_foreign_key(None, 'conditional', 'freshman_eval_data', ['i_evaluation'], ['id'])
    op.drop_column('conditional', 'evaluation')
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('conditional', sa.Column('evaluation', sa.INTEGER(), autoincrement=False, nullable=True))
    op.drop_constraint(None, 'conditional', type_='foreignkey')
    op.drop_constraint(None, 'conditional', type_='foreignkey')
    op.create_foreign_key('conditional_evaluation_fkey', 'conditional', 'spring_evals', ['evaluation'], ['id'])
    op.drop_column('conditional', 's_evaluation')
    op.drop_column('conditional', 'i_evaluation')
    ### end Alembic commands ###
