"""empty message

Revision ID: 86b9f74eba3b
Revises: 469b5ce9a23e
Create Date: 2018-10-01 09:51:28.965813

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '86b9f74eba3b'
down_revision = '469b5ce9a23e'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('optom_there', sa.Column('practice', sa.String(length=20), nullable=True))
    op.create_index(op.f('ix_optom_there_practice'), 'optom_there', ['practice'], unique=False)
    op.drop_index('ix_optom_there_Practice', table_name='optom_there')
    op.drop_column('optom_there', 'Practice')
    op.alter_column('quest_ans', 'answer',
               existing_type=sa.VARCHAR(),
               nullable=True)
    op.alter_column('quest_ans', 'question',
               existing_type=sa.VARCHAR(),
               nullable=True)
    op.create_index(op.f('ix_quest_ans_answer'), 'quest_ans', ['answer'], unique=False)
    op.create_index(op.f('ix_quest_ans_question'), 'quest_ans', ['question'], unique=False)
    op.drop_index('quest_ans_id_uindex', table_name='quest_ans')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_index('quest_ans_id_uindex', 'quest_ans', ['id'], unique=1)
    op.drop_index(op.f('ix_quest_ans_question'), table_name='quest_ans')
    op.drop_index(op.f('ix_quest_ans_answer'), table_name='quest_ans')
    op.alter_column('quest_ans', 'question',
               existing_type=sa.VARCHAR(),
               nullable=False)
    op.alter_column('quest_ans', 'answer',
               existing_type=sa.VARCHAR(),
               nullable=False)
    op.add_column('optom_there', sa.Column('Practice', sa.VARCHAR(length=20), nullable=True))
    op.create_index('ix_optom_there_Practice', 'optom_there', ['Practice'], unique=False)
    op.drop_index(op.f('ix_optom_there_practice'), table_name='optom_there')
    op.drop_column('optom_there', 'practice')
    # ### end Alembic commands ###
