"""empty message

Revision ID: 6fe7b22399a5
Revises: e902da0ec343
Create Date: 2020-10-30 15:58:19.077708

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '6fe7b22399a5'
down_revision = 'e902da0ec343'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('cmf_u_work_chat_group', sa.Column('last_topic_id', sa.CHAR(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_u_work_chat_group_last_topic_id'), 'cmf_u_work_chat_group', ['last_topic_id'], unique=False)
    op.create_foreign_key(None, 'cmf_u_work_chat_group', 'cmf_u_work_chat_topic', ['last_topic_id'], ['id'])
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'cmf_u_work_chat_group', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_u_work_chat_group_last_topic_id'), table_name='cmf_u_work_chat_group')
    op.drop_column('cmf_u_work_chat_group', 'last_topic_id')
    # ### end Alembic commands ###
