"""empty message

Revision ID: 3ffcc3f3b6b2
Revises: 9bf7074909b1
Create Date: 2020-05-24 16:02:04.724050

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '3ffcc3f3b6b2'
down_revision = '9bf7074909b1'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('categories', 'type',
               existing_type=sa.VARCHAR(),
               nullable=False)
    op.add_column('questions', sa.Column('category_id', sa.Integer()))
    op.alter_column('questions', 'answer',
               existing_type=sa.VARCHAR(),
               nullable=False)
    op.alter_column('questions', 'difficulty',
               existing_type=sa.INTEGER(),
               nullable=False)
    op.alter_column('questions', 'question',
               existing_type=sa.VARCHAR(),
               nullable=False)
    op.drop_column('questions', 'category')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('questions', sa.Column('category', sa.VARCHAR(), autoincrement=False, nullable=True))
    op.alter_column('questions', 'question',
               existing_type=sa.VARCHAR(),
               nullable=True)
    op.alter_column('questions', 'difficulty',
               existing_type=sa.INTEGER(),
               nullable=True)
    op.alter_column('questions', 'answer',
               existing_type=sa.VARCHAR(),
               nullable=True)
    op.drop_column('questions', 'category_id')
    op.alter_column('categories', 'type',
               existing_type=sa.VARCHAR(),
               nullable=True)
    # ### end Alembic commands ###
