"""updated pypeline model

Revision ID: 7f24fc243552
Revises: 966b1d57488d
Create Date: 2016-06-14 15:26:32.496002

"""

# revision identifiers, used by Alembic.
revision = '7f24fc243552'
down_revision = '966b1d57488d'

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql

def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('pipelines', sa.Column('type_id', sa.Integer(), nullable=True))
    op.drop_constraint(u'pipelines_ibfk_7', 'pipelines', type_='foreignkey')
    op.create_foreign_key(None, 'pipelines', 'pipeline_types', ['type_id'], ['id'])
    op.drop_column('pipelines', 'type')
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('pipelines', sa.Column('type', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True))
    op.drop_constraint(None, 'pipelines', type_='foreignkey')
    op.create_foreign_key(u'pipelines_ibfk_7', 'pipelines', 'pipeline_types', ['type'], ['id'])
    op.drop_column('pipelines', 'type_id')
    ### end Alembic commands ###