"""empty message

Revision ID: 9a722e88bd70
Revises: 4ac0914a6c72
Create Date: 2019-08-02 20:38:14.939104

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

# revision identifiers, used by Alembic.
revision = '9a722e88bd70'
down_revision = '4ac0914a6c72'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('paper', sa.Column('attr', sa.Text(), nullable=True))
    op.add_column('paper', sa.Column('paper_type', sa.String(length=2), nullable=False))
    op.add_column('paper', sa.Column('question', sa.Text(), nullable=True))
    op.drop_column('paper', 'type')
    op.add_column('question', sa.Column('input', sa.Text(), nullable=True))
    op.add_column('question', sa.Column('output', sa.Text(), nullable=True))
    op.add_column('question', sa.Column('type', sa.Integer(), nullable=False))
    op.alter_column('question', 'name',
               existing_type=mysql.VARCHAR(length=50),
               nullable=True)
    op.drop_constraint('question_ibfk_1', 'question', type_='foreignkey')
    op.drop_column('question', 'paper_id')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('question', sa.Column('paper_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True))
    op.create_foreign_key('question_ibfk_1', 'question', 'paper', ['paper_id'], ['id'])
    op.alter_column('question', 'name',
               existing_type=mysql.VARCHAR(length=50),
               nullable=False)
    op.drop_column('question', 'type')
    op.drop_column('question', 'output')
    op.drop_column('question', 'input')
    op.add_column('paper', sa.Column('type', mysql.VARCHAR(length=2), nullable=False))
    op.drop_column('paper', 'question')
    op.drop_column('paper', 'paper_type')
    op.drop_column('paper', 'attr')
    # ### end Alembic commands ###
