"""empty message

Revision ID: 9c4ee26cfaa7
Revises: 22cd0b59ef9c
Create Date: 2019-10-10 16:07:58.268628

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '9c4ee26cfaa7'
down_revision = '22cd0b59ef9c'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('answers', sa.Column('question_id', sa.Integer(), nullable=True))
    op.alter_column('answers', 'is_admin_answer',
               existing_type=sa.BOOLEAN(),
               nullable=True)
    op.drop_constraint('answers_question_fkey', 'answers', type_='foreignkey')
    op.create_foreign_key(None, 'answers', 'questions', ['question_id'], ['id'])
    op.drop_column('answers', 'question')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('answers', sa.Column('question', sa.INTEGER(), autoincrement=False, nullable=True))
    op.drop_constraint(None, 'answers', type_='foreignkey')
    op.create_foreign_key('answers_question_fkey', 'answers', 'questions', ['question'], ['id'])
    op.alter_column('answers', 'is_admin_answer',
               existing_type=sa.BOOLEAN(),
               nullable=False)
    op.drop_column('answers', 'question_id')
    # ### end Alembic commands ###
