"""empty message

Revision ID: a655fd9c412c
Revises: 32e5f5b7678f
Create Date: 2016-05-14 19:38:08.434122

"""

# revision identifiers, used by Alembic.
revision = 'a655fd9c412c'
down_revision = '32e5f5b7678f'

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

def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('author', 'is_author',
               existing_type=mysql.TINYINT(display_width=1),
               type_=sa.Boolean(),
               existing_nullable=True)
    op.add_column('comment', sa.Column('post_id', sa.Integer(), nullable=True))
    op.create_foreign_key(None, 'comment', 'post', ['post_id'], ['id'])
    op.alter_column('post', 'live',
               existing_type=mysql.TINYINT(display_width=1),
               type_=sa.Boolean(),
               existing_nullable=True)
    op.drop_constraint('post_ibfk_4', 'post', type_='foreignkey')
    op.drop_column('post', 'comment_id')
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('post', sa.Column('comment_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True))
    op.create_foreign_key('post_ibfk_4', 'post', 'comment', ['comment_id'], ['id'])
    op.alter_column('post', 'live',
               existing_type=sa.Boolean(),
               type_=mysql.TINYINT(display_width=1),
               existing_nullable=True)
    op.drop_constraint(None, 'comment', type_='foreignkey')
    op.drop_column('comment', 'post_id')
    op.alter_column('author', 'is_author',
               existing_type=sa.Boolean(),
               type_=mysql.TINYINT(display_width=1),
               existing_nullable=True)
    ### end Alembic commands ###
