"""topic unread comment

Revision ID: e12c528c38cb
Revises: 4bc1cf49e967
Create Date: 2021-10-04 14:23:41.563055

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

# revision identifiers, used by Alembic.
revision = 'e12c528c38cb'
down_revision = '4bc1cf49e967'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index('ix_cmf_topic_unread_comment_cmf_author_id', table_name='cmf_topic_unread_comment')
    op.drop_index('ix_cmf_topic_unread_comment_cmf_created_at', table_name='cmf_topic_unread_comment')
    op.drop_index('ix_cmf_topic_unread_comment_cmf_deleted', table_name='cmf_topic_unread_comment')
    op.drop_index('ix_cmf_topic_unread_comment_cmf_locked_at', table_name='cmf_topic_unread_comment')
    op.drop_index('ix_cmf_topic_unread_comment_cmf_locked_by_id', table_name='cmf_topic_unread_comment')
    op.drop_index('ix_cmf_topic_unread_comment_cmf_modified_at', table_name='cmf_topic_unread_comment')
    op.drop_index('ix_cmf_topic_unread_comment_cmf_modified_by_id', table_name='cmf_topic_unread_comment')
    op.drop_index('ix_cmf_topic_unread_comment_cmf_owner_assistant_id', table_name='cmf_topic_unread_comment')
    op.drop_index('ix_cmf_topic_unread_comment_cmf_owner_id', table_name='cmf_topic_unread_comment')
    op.drop_index('ix_cmf_topic_unread_comment_cmf_version', table_name='cmf_topic_unread_comment')
    op.drop_index('ix_cmf_topic_unread_comment_cmf_viewed_at', table_name='cmf_topic_unread_comment')
    op.drop_index('ix_cmf_topic_unread_comment_parent_id', table_name='cmf_topic_unread_comment')
    op.drop_column('cmf_topic_unread_comment', 'cmf_owner_id')
    op.drop_column('cmf_topic_unread_comment', 'cmf_author_id')
    op.drop_column('cmf_topic_unread_comment', 'cmf_owner_assistant_id')
    op.drop_column('cmf_topic_unread_comment', 'cmf_modified_by_id')
    op.drop_column('cmf_topic_unread_comment', 'cmf_locked_at')
    op.drop_column('cmf_topic_unread_comment', 'cmf_deleted')
    op.drop_column('cmf_topic_unread_comment', 'cmf_version')
    op.drop_column('cmf_topic_unread_comment', 'parent_id')
    op.drop_column('cmf_topic_unread_comment', 'cmf_created_at')
    op.drop_column('cmf_topic_unread_comment', 'cmf_locked_by_id')
    op.drop_column('cmf_topic_unread_comment', 'cmf_modified_at')
    op.drop_column('cmf_topic_unread_comment', 'cmf_viewed_at')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('cmf_topic_unread_comment', sa.Column('cmf_viewed_at', postgresql.TIMESTAMP(timezone=True), autoincrement=False, nullable=True))
    op.add_column('cmf_topic_unread_comment', sa.Column('cmf_modified_at', postgresql.TIMESTAMP(timezone=True), autoincrement=False, nullable=False))
    op.add_column('cmf_topic_unread_comment', sa.Column('cmf_locked_by_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True))
    op.add_column('cmf_topic_unread_comment', sa.Column('cmf_created_at', postgresql.TIMESTAMP(timezone=True), autoincrement=False, nullable=False))
    op.add_column('cmf_topic_unread_comment', sa.Column('parent_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True))
    op.add_column('cmf_topic_unread_comment', sa.Column('cmf_version', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('cmf_topic_unread_comment', sa.Column('cmf_deleted', sa.BOOLEAN(), autoincrement=False, nullable=False))
    op.add_column('cmf_topic_unread_comment', sa.Column('cmf_locked_at', postgresql.TIMESTAMP(timezone=True), autoincrement=False, nullable=True))
    op.add_column('cmf_topic_unread_comment', sa.Column('cmf_modified_by_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True))
    op.add_column('cmf_topic_unread_comment', sa.Column('cmf_owner_assistant_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True))
    op.add_column('cmf_topic_unread_comment', sa.Column('cmf_author_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True))
    op.add_column('cmf_topic_unread_comment', sa.Column('cmf_owner_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True))
    op.create_index('ix_cmf_topic_unread_comment_parent_id', 'cmf_topic_unread_comment', ['parent_id'], unique=False)
    op.create_index('ix_cmf_topic_unread_comment_cmf_viewed_at', 'cmf_topic_unread_comment', ['cmf_viewed_at'], unique=False)
    op.create_index('ix_cmf_topic_unread_comment_cmf_version', 'cmf_topic_unread_comment', ['cmf_version'], unique=False)
    op.create_index('ix_cmf_topic_unread_comment_cmf_owner_id', 'cmf_topic_unread_comment', ['cmf_owner_id'], unique=False)
    op.create_index('ix_cmf_topic_unread_comment_cmf_owner_assistant_id', 'cmf_topic_unread_comment', ['cmf_owner_assistant_id'], unique=False)
    op.create_index('ix_cmf_topic_unread_comment_cmf_modified_by_id', 'cmf_topic_unread_comment', ['cmf_modified_by_id'], unique=False)
    op.create_index('ix_cmf_topic_unread_comment_cmf_modified_at', 'cmf_topic_unread_comment', ['cmf_modified_at'], unique=False)
    op.create_index('ix_cmf_topic_unread_comment_cmf_locked_by_id', 'cmf_topic_unread_comment', ['cmf_locked_by_id'], unique=False)
    op.create_index('ix_cmf_topic_unread_comment_cmf_locked_at', 'cmf_topic_unread_comment', ['cmf_locked_at'], unique=False)
    op.create_index('ix_cmf_topic_unread_comment_cmf_deleted', 'cmf_topic_unread_comment', ['cmf_deleted'], unique=False)
    op.create_index('ix_cmf_topic_unread_comment_cmf_created_at', 'cmf_topic_unread_comment', ['cmf_created_at'], unique=False)
    op.create_index('ix_cmf_topic_unread_comment_cmf_author_id', 'cmf_topic_unread_comment', ['cmf_author_id'], unique=False)
    # ### end Alembic commands ###
