"""empty message

Revision ID: 6ba9a47dc242
Revises: ab9961fd6267
Create Date: 2020-02-13 12:02:11.558939

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

# revision identifiers, used by Alembic.
revision = '6ba9a47dc242'
down_revision = 'ab9961fd6267'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('user_group_chat_log', sa.Column('group_id', sa.Integer(), nullable=True))
    op.add_column('user_group_chat_log', sa.Column('isread', sa.Boolean(), nullable=True))
    op.drop_constraint('user_group_chat_log_ibfk_1', 'user_group_chat_log', type_='foreignkey')
    op.create_foreign_key(None, 'user_group_chat_log', 'user_group', ['group_id'], ['id'])
    op.drop_column('user_group_chat_log', 'from_group')
    op.drop_column('user_group_chat_log', 'has_read')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('user_group_chat_log', sa.Column('has_read', mysql.TINYINT(display_width=1), autoincrement=False, nullable=True))
    op.add_column('user_group_chat_log', sa.Column('from_group', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True))
    op.drop_constraint(None, 'user_group_chat_log', type_='foreignkey')
    op.create_foreign_key('user_group_chat_log_ibfk_1', 'user_group_chat_log', 'user_group', ['from_group'], ['id'])
    op.drop_column('user_group_chat_log', 'isread')
    op.drop_column('user_group_chat_log', 'group_id')
    # ### end Alembic commands ###
