"""empty message

Revision ID: 5df3c7a5f2a9
Revises: 6fe7b22399a5
Create Date: 2020-11-03 15:50:53.346712

"""
from alembic import op
import sqlalchemy as sa


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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('cmf_comment', sa.Column('cache_cmf_author_code', sa.String(length=64), nullable=True))
    op.add_column('cmf_comment', sa.Column('cache_cmf_author_login', sa.String(length=64), nullable=True))
    op.add_column('cmf_comment', sa.Column('cache_cmf_author_name', sa.String(length=256), nullable=True))
    op.create_index(op.f('ix_cmf_comment_cache_cmf_author_code'), 'cmf_comment', ['cache_cmf_author_code'], unique=False)
    op.create_index(op.f('ix_cmf_comment_cache_cmf_author_name'), 'cmf_comment', ['cache_cmf_author_name'], unique=False)
    # op.drop_constraint('cmf_u_work_chat_group_ibfk_6', 'cmf_u_work_chat_group', type_='foreignkey')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    # op.create_foreign_key('cmf_u_work_chat_group_ibfk_6', 'cmf_u_work_chat_group', 'cmf_u_work_chat_topic', ['last_topic_id'], ['id'])
    op.drop_index(op.f('ix_cmf_comment_cache_cmf_author_name'), table_name='cmf_comment')
    op.drop_index(op.f('ix_cmf_comment_cache_cmf_author_code'), table_name='cmf_comment')
    op.drop_column('cmf_comment', 'cache_cmf_author_name')
    op.drop_column('cmf_comment', 'cache_cmf_author_login')
    op.drop_column('cmf_comment', 'cache_cmf_author_code')
    # ### end Alembic commands ###
