"""empty message

Revision ID: 3730d5f165c1
Revises: cf5d3426976c
Create Date: 2019-12-07 08:33:51.790264

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

# revision identifiers, used by Alembic.
revision = '3730d5f165c1'
down_revision = 'cf5d3426976c'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('comment', sa.Column('content', sa.String(length=100), nullable=True))
    op.add_column('comment', sa.Column('user_id', sa.Integer(), nullable=True))
    op.create_index(op.f('ix_comment_content'), 'comment', ['content'], unique=False)
    op.drop_index('ix_comment_comment', table_name='comment')
    op.drop_index('ix_comment_post_author', table_name='comment')
    op.create_foreign_key(None, 'comment', 'user', ['user_id'], ['id'])
    op.drop_column('comment', 'comment')
    op.drop_column('comment', 'author')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('comment', sa.Column('author', mysql.VARCHAR(length=50), nullable=True))
    op.add_column('comment', sa.Column('comment', mysql.VARCHAR(length=100), nullable=True))
    op.drop_constraint(None, 'comment', type_='foreignkey')
    op.create_index('ix_comment_post_author', 'comment', ['author'], unique=False)
    op.create_index('ix_comment_comment', 'comment', ['comment'], unique=False)
    op.drop_index(op.f('ix_comment_content'), table_name='comment')
    op.drop_column('comment', 'user_id')
    op.drop_column('comment', 'content')
    # ### end Alembic commands ###
