"""Add question_id to AnswerComment.

Revision ID: 5791f7adaa15
Revises: e2a6a5bbd5a
Create Date: 2015-06-29 12:46:43.456876

"""

# revision identifiers, used by Alembic.
revision = '5791f7adaa15'
down_revision = 'e2a6a5bbd5a'

from alembic import op
import sqlalchemy as sa


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('answer_comment', sa.Column('question_id', sa.Integer(), nullable=True))
    op.create_foreign_key(None, 'answer_comment', 'question', ['question_id'], ['id'])
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'answer_comment', type_='foreignkey')
    op.drop_column('answer_comment', 'question_id')
    ### end Alembic commands ###
