"""updated i/o param in Task model

Revision ID: 041111f828b0
Revises: 344ce4edecb1
Create Date: 2016-06-14 16:07:49.493550

"""

# revision identifiers, used by Alembic.
revision = '041111f828b0'
down_revision = '344ce4edecb1'

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('tasks', sa.Column('input', sa.Integer(), nullable=True))
    op.add_column('tasks', sa.Column('output', sa.Integer(), nullable=True))
    op.create_foreign_key(None, 'tasks', 'containers', ['output'], ['id'])
    op.create_foreign_key(None, 'tasks', 'containers', ['input'], ['id'])
    op.drop_column('tasks', 'ifiles')
    op.drop_column('tasks', 'ofiles')
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('tasks', sa.Column('ofiles', mysql.VARCHAR(length=1024), nullable=True))
    op.add_column('tasks', sa.Column('ifiles', mysql.VARCHAR(length=1024), nullable=True))
    op.drop_constraint(None, 'tasks', type_='foreignkey')
    op.drop_constraint(None, 'tasks', type_='foreignkey')
    op.drop_column('tasks', 'output')
    op.drop_column('tasks', 'input')
    ### end Alembic commands ###