"""added pipeline model

Revision ID: 00fddd34b7e1
Revises: a48de3a5cfc9
Create Date: 2016-05-31 18:49:57.419474

"""

# revision identifiers, used by Alembic.
revision = '00fddd34b7e1'
down_revision = 'a48de3a5cfc9'

from alembic import op
import sqlalchemy as sa


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('pipelines',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=256), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.add_column(u'tasks', sa.Column('pipeline_id', sa.Integer(), nullable=True))
    op.create_foreign_key(None, 'tasks', 'pipelines', ['pipeline_id'], ['id'])
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'tasks', type_='foreignkey')
    op.drop_column(u'tasks', 'pipeline_id')
    op.drop_table('pipelines')
    ### end Alembic commands ###