"""empty message

Revision ID: 88e485ebc3ab
Revises: 
Create Date: 2020-09-11 08:40:57.703618

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '88e485ebc3ab'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('cmf_activity',
    sa.Column('cmf_author_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_created_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_deleted', sa.Boolean(), nullable=False),
    sa.Column('cmf_locked_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_locked_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_modified_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_modified_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_owner_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_version', sa.Integer(), nullable=True),
    sa.Column('cmf_viewed_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('code', sa.String(length=64), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('name', sa.String(length=256), nullable=True),
    sa.Column('text', sa.TEXT(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_activity_code'), 'cmf_activity', ['code'], unique=True)
    op.create_index(op.f('ix_cmf_activity_name'), 'cmf_activity', ['name'], unique=False)
    op.create_table('cmf_attachment',
    sa.Column('cmf_author_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_created_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_deleted', sa.Boolean(), nullable=False),
    sa.Column('cmf_locked_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_locked_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_modified_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_modified_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_owner_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_version', sa.Integer(), nullable=True),
    sa.Column('cmf_viewed_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('code', sa.String(length=64), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('name', sa.String(length=256), nullable=True),
    sa.Column('parent_id', sa.CHAR(length=64), nullable=True),
    sa.Column('text', sa.TEXT(), nullable=True),
    sa.Column('url', sa.String(length=256), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_attachment_code'), 'cmf_attachment', ['code'], unique=True)
    op.create_index(op.f('ix_cmf_attachment_name'), 'cmf_attachment', ['name'], unique=False)
    op.create_table('cmf_auth',
    sa.Column('cmf_author_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_created_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_deleted', sa.Boolean(), nullable=False),
    sa.Column('cmf_locked_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_locked_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_modified_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_modified_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_owner_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_version', sa.Integer(), nullable=True),
    sa.Column('cmf_viewed_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('email', sa.String(length=64), nullable=True),
    sa.Column('groups', sa.String(length=4096), nullable=True),
    sa.Column('hash_ntlmv2', sa.String(length=256), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('login', sa.String(length=64), nullable=True),
    sa.Column('name', sa.String(length=256), nullable=True),
    sa.Column('pass_hash', sa.String(length=256), nullable=True),
    sa.Column('phone', sa.String(length=32), nullable=True),
    sa.Column('posix_gid', sa.Integer(), nullable=True),
    sa.Column('posix_uid', sa.Integer(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_auth_email'), 'cmf_auth', ['email'], unique=True)
    op.create_index(op.f('ix_cmf_auth_login'), 'cmf_auth', ['login'], unique=True)
    op.create_index(op.f('ix_cmf_auth_name'), 'cmf_auth', ['name'], unique=False)
    op.create_index(op.f('ix_cmf_auth_posix_gid'), 'cmf_auth', ['posix_gid'], unique=True)
    op.create_index(op.f('ix_cmf_auth_posix_uid'), 'cmf_auth', ['posix_uid'], unique=True)
    op.create_table('cmf_comment',
    sa.Column('cmf_author_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_created_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_deleted', sa.Boolean(), nullable=False),
    sa.Column('cmf_locked_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_locked_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_modified_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_modified_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_owner_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_version', sa.Integer(), nullable=True),
    sa.Column('cmf_viewed_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('code', sa.String(length=64), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('important', sa.Boolean(), nullable=True),
    sa.Column('is_audit', sa.Boolean(), nullable=True),
    sa.Column('likes', sa.TEXT(), nullable=True),
    sa.Column('name', sa.String(length=256), nullable=True),
    sa.Column('parent_id', sa.CHAR(length=64), nullable=True),
    sa.Column('text', sa.TEXT(), nullable=True),
    sa.Column('tree_parent_id', sa.CHAR(length=64), nullable=True),
    sa.Column('views', sa.TEXT(), nullable=True),
    sa.ForeignKeyConstraint(['tree_parent_id'], ['cmf_comment.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_comment_code'), 'cmf_comment', ['code'], unique=True)
    op.create_index(op.f('ix_cmf_comment_name'), 'cmf_comment', ['name'], unique=False)
    op.create_table('cmf_company',
    sa.Column('cmf_author_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_created_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_deleted', sa.Boolean(), nullable=False),
    sa.Column('cmf_locked_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_locked_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_modified_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_modified_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_owner_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_version', sa.Integer(), nullable=True),
    sa.Column('cmf_viewed_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('code', sa.String(length=64), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('is_internal', sa.Boolean(), nullable=True),
    sa.Column('is_penalty_block', sa.Boolean(), nullable=True),
    sa.Column('name', sa.String(length=256), nullable=True),
    sa.Column('text', sa.TEXT(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_company_code'), 'cmf_company', ['code'], unique=True)
    op.create_index(op.f('ix_cmf_company_name'), 'cmf_company', ['name'], unique=False)
    op.create_table('cmf_document_executors',
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('left_id', sa.CHAR(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('right_id', sa.CHAR(length=64), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('cmf_document_related_objects',
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('left_id', sa.CHAR(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('right_id', sa.CHAR(length=64), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('cmf_document_spectators',
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('left_id', sa.CHAR(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('right_id', sa.CHAR(length=64), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('cmf_feed',
    sa.Column('cmf_author_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_created_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_deleted', sa.Boolean(), nullable=False),
    sa.Column('cmf_locked_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_locked_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_modified_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_modified_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_owner_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_version', sa.Integer(), nullable=True),
    sa.Column('cmf_viewed_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('code', sa.String(length=64), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('name', sa.String(length=256), nullable=True),
    sa.Column('orderno', sa.Integer(), nullable=True),
    sa.Column('sys_type', sa.String(length=32), nullable=True),
    sa.Column('text', sa.TEXT(), nullable=True),
    sa.Column('tree_parent_id', sa.CHAR(length=64), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_feed_code'), 'cmf_feed', ['code'], unique=True)
    op.create_index(op.f('ix_cmf_feed_name'), 'cmf_feed', ['name'], unique=False)
    op.create_index(op.f('ix_cmf_feed_orderno'), 'cmf_feed', ['orderno'], unique=False)
    op.create_table('cmf_job',
    sa.Column('cmf_author_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_created_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_deleted', sa.Boolean(), nullable=False),
    sa.Column('cmf_locked_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_locked_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_modified_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_modified_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_owner_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_version', sa.Integer(), nullable=True),
    sa.Column('cmf_viewed_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('code', sa.String(length=64), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('name', sa.String(length=256), nullable=True),
    sa.Column('text', sa.TEXT(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_job_code'), 'cmf_job', ['code'], unique=True)
    op.create_index(op.f('ix_cmf_job_name'), 'cmf_job', ['name'], unique=False)
    op.create_table('cmf_person_group_rg_members',
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('left_id', sa.CHAR(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('right_id', sa.CHAR(length=64), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('cmf_plan',
    sa.Column('cmf_author_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_created_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_deleted', sa.Boolean(), nullable=False),
    sa.Column('cmf_locked_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_locked_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_modified_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_modified_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_owner_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_version', sa.Integer(), nullable=True),
    sa.Column('cmf_viewed_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('code', sa.String(length=64), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('name', sa.String(length=256), nullable=True),
    sa.Column('text', sa.TEXT(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_plan_code'), 'cmf_plan', ['code'], unique=True)
    op.create_index(op.f('ix_cmf_plan_name'), 'cmf_plan', ['name'], unique=False)
    op.create_table('cmf_project',
    sa.Column('activity_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_author_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_created_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_deleted', sa.Boolean(), nullable=False),
    sa.Column('cmf_locked_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_locked_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_modified_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_modified_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_owner_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_version', sa.Integer(), nullable=True),
    sa.Column('cmf_viewed_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('code', sa.String(length=64), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('name', sa.String(length=256), nullable=True),
    sa.Column('project_type', sa.String(length=32), nullable=True),
    sa.Column('show_archive', sa.Boolean(), nullable=True),
    sa.Column('show_docs', sa.Boolean(), nullable=True),
    sa.Column('show_feed', sa.Boolean(), nullable=True),
    sa.Column('show_in_work', sa.Boolean(), nullable=True),
    sa.Column('show_inbox', sa.Boolean(), nullable=True),
    sa.Column('show_meetings', sa.Boolean(), nullable=True),
    sa.Column('show_todo', sa.Boolean(), nullable=True),
    sa.Column('show_trash', sa.Boolean(), nullable=True),
    sa.Column('text', sa.TEXT(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_project_code'), 'cmf_project', ['code'], unique=True)
    op.create_index(op.f('ix_cmf_project_name'), 'cmf_project', ['name'], unique=False)
    op.create_table('cmf_project_executors',
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('left_id', sa.CHAR(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('right_id', sa.CHAR(length=64), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('cmf_project_spectators',
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('left_id', sa.CHAR(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('right_id', sa.CHAR(length=64), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('cmf_u_work_chat_group_executors',
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('left_id', sa.CHAR(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('right_id', sa.CHAR(length=64), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('cmf_u_work_chat_group_related_objects',
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('left_id', sa.CHAR(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('right_id', sa.CHAR(length=64), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('cmf_u_work_chat_group_spectators',
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('left_id', sa.CHAR(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('right_id', sa.CHAR(length=64), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('cmf_u_work_chat_topic_executors',
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('left_id', sa.CHAR(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('right_id', sa.CHAR(length=64), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('cmf_u_work_chat_topic_related_objects',
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('left_id', sa.CHAR(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('right_id', sa.CHAR(length=64), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('cmf_u_work_chat_topic_spectators',
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('left_id', sa.CHAR(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('right_id', sa.CHAR(length=64), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('cmf_u_work_list_executors',
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('left_id', sa.CHAR(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('right_id', sa.CHAR(length=64), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('cmf_u_work_list_members',
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('left_id', sa.CHAR(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('right_id', sa.CHAR(length=64), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('cmf_u_work_list_related_objects',
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('left_id', sa.CHAR(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('right_id', sa.CHAR(length=64), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('cmf_u_work_list_spectators',
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('left_id', sa.CHAR(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('right_id', sa.CHAR(length=64), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('cmf_u_work_post_executors',
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('left_id', sa.CHAR(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('right_id', sa.CHAR(length=64), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('cmf_u_work_post_related_objects',
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('left_id', sa.CHAR(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('right_id', sa.CHAR(length=64), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('cmf_u_work_post_spectators',
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('left_id', sa.CHAR(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('right_id', sa.CHAR(length=64), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('cmf_u_work_task_executors',
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('left_id', sa.CHAR(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('right_id', sa.CHAR(length=64), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('cmf_u_work_task_related_objects',
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('left_id', sa.CHAR(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('right_id', sa.CHAR(length=64), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('cmf_u_work_task_spectators',
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('left_id', sa.CHAR(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('right_id', sa.CHAR(length=64), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('cmf_folder',
    sa.Column('activity_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_author_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_created_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_deleted', sa.Boolean(), nullable=False),
    sa.Column('cmf_locked_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_locked_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_modified_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_modified_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_owner_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_version', sa.Integer(), nullable=True),
    sa.Column('cmf_viewed_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('code', sa.String(length=64), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('name', sa.String(length=256), nullable=True),
    sa.Column('orderno', sa.Integer(), nullable=True),
    sa.Column('sys_type', sa.String(length=32), nullable=True),
    sa.Column('text', sa.TEXT(), nullable=True),
    sa.Column('tree_parent_id', sa.CHAR(length=64), nullable=True),
    sa.ForeignKeyConstraint(['activity_id'], ['cmf_activity.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_folder_code'), 'cmf_folder', ['code'], unique=True)
    op.create_index(op.f('ix_cmf_folder_name'), 'cmf_folder', ['name'], unique=False)
    op.create_index(op.f('ix_cmf_folder_orderno'), 'cmf_folder', ['orderno'], unique=False)
    op.create_table('cmf_person',
    sa.Column('activity_id', sa.CHAR(length=64), nullable=True),
    sa.Column('birthday', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_author_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_created_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_deleted', sa.Boolean(), nullable=False),
    sa.Column('cmf_locked_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_locked_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_modified_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_modified_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_owner_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_version', sa.Integer(), nullable=True),
    sa.Column('cmf_viewed_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('code', sa.String(length=64), nullable=True),
    sa.Column('company_id', sa.CHAR(length=64), nullable=True),
    sa.Column('email', sa.String(length=64), nullable=True),
    sa.Column('email_2', sa.String(length=32), nullable=True),
    sa.Column('facebook', sa.String(length=128), nullable=True),
    sa.Column('first_name', sa.String(length=64), nullable=True),
    sa.Column('gid', sa.Integer(), nullable=True),
    sa.Column('has_penalty', sa.Boolean(), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('instagram', sa.String(length=128), nullable=True),
    sa.Column('ip_address', sa.String(length=32), nullable=True),
    sa.Column('is_internal', sa.Boolean(), nullable=True),
    sa.Column('last_name', sa.String(length=64), nullable=True),
    sa.Column('linkedin', sa.String(length=128), nullable=True),
    sa.Column('login', sa.String(length=64), nullable=True),
    sa.Column('messenger', sa.String(length=128), nullable=True),
    sa.Column('name', sa.String(length=256), nullable=True),
    sa.Column('ok', sa.String(length=128), nullable=True),
    sa.Column('penalty_promise_hour', sa.Integer(), nullable=True),
    sa.Column('penalty_reason', sa.String(length=64), nullable=True),
    sa.Column('phone', sa.String(length=32), nullable=True),
    sa.Column('phone_2', sa.String(length=32), nullable=True),
    sa.Column('phone_assistant', sa.String(length=32), nullable=True),
    sa.Column('phone_internal', sa.String(length=32), nullable=True),
    sa.Column('phone_mobile', sa.String(length=32), nullable=True),
    sa.Column('project_id', sa.CHAR(length=64), nullable=True),
    sa.Column('second_name', sa.String(length=64), nullable=True),
    sa.Column('skype', sa.String(length=128), nullable=True),
    sa.Column('slack', sa.String(length=128), nullable=True),
    sa.Column('snapchat', sa.String(length=128), nullable=True),
    sa.Column('telegram', sa.String(length=128), nullable=True),
    sa.Column('text', sa.TEXT(), nullable=True),
    sa.Column('uid', sa.Integer(), nullable=True),
    sa.Column('viber', sa.String(length=128), nullable=True),
    sa.Column('vk', sa.String(length=128), nullable=True),
    sa.Column('whatsapp', sa.String(length=128), nullable=True),
    sa.Column('zoom', sa.String(length=128), nullable=True),
    sa.ForeignKeyConstraint(['activity_id'], ['cmf_activity.id'], ),
    sa.ForeignKeyConstraint(['company_id'], ['cmf_company.id'], ),
    sa.ForeignKeyConstraint(['project_id'], ['cmf_project.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_person_code'), 'cmf_person', ['code'], unique=True)
    op.create_index(op.f('ix_cmf_person_login'), 'cmf_person', ['login'], unique=True)
    op.create_index(op.f('ix_cmf_person_name'), 'cmf_person', ['name'], unique=False)
    op.create_index(op.f('ix_cmf_person_uid'), 'cmf_person', ['uid'], unique=True)
    op.create_table('cmf_status',
    sa.Column('cmf_author_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_created_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_deleted', sa.Boolean(), nullable=False),
    sa.Column('cmf_locked_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_locked_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_model', sa.String(length=256), nullable=True),
    sa.Column('cmf_model_activity_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_modified_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_modified_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_owner_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_version', sa.Integer(), nullable=True),
    sa.Column('cmf_viewed_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('code', sa.String(length=64), nullable=True),
    sa.Column('color', sa.String(length=32), nullable=True),
    sa.Column('default_deadline_shift', sa.Integer(), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('name', sa.String(length=256), nullable=True),
    sa.Column('next_alarm', sa.Integer(), nullable=True),
    sa.Column('options', sa.TEXT(), nullable=True),
    sa.Column('orderno', sa.Integer(), nullable=True),
    sa.Column('status_type', sa.String(length=32), nullable=True),
    sa.Column('text', sa.TEXT(), nullable=True),
    sa.ForeignKeyConstraint(['cmf_model_activity_id'], ['cmf_activity.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_status_code'), 'cmf_status', ['code'], unique=False)
    op.create_index(op.f('ix_cmf_status_name'), 'cmf_status', ['name'], unique=False)
    op.create_table('cmf_u_work_type',
    sa.Column('activity_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_author_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_created_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_deleted', sa.Boolean(), nullable=False),
    sa.Column('cmf_locked_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_locked_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_modified_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_modified_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_owner_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_version', sa.Integer(), nullable=True),
    sa.Column('cmf_viewed_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('code', sa.String(length=64), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('name', sa.String(length=256), nullable=True),
    sa.Column('orderno', sa.Integer(), nullable=True),
    sa.Column('text', sa.TEXT(), nullable=True),
    sa.ForeignKeyConstraint(['activity_id'], ['cmf_activity.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_u_work_type_code'), 'cmf_u_work_type', ['code'], unique=True)
    op.create_index(op.f('ix_cmf_u_work_type_name'), 'cmf_u_work_type', ['name'], unique=False)
    op.create_table('cmf_document',
    sa.Column('activity_id', sa.CHAR(length=64), nullable=True),
    sa.Column('alarm_date', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_author_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_created_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_deleted', sa.Boolean(), nullable=False),
    sa.Column('cmf_locked_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_locked_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_modified_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_modified_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_owner_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_version', sa.Integer(), nullable=True),
    sa.Column('cmf_viewed_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('code', sa.String(length=64), nullable=True),
    sa.Column('company_id', sa.CHAR(length=64), nullable=True),
    sa.Column('deadline', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('file_path', sa.String(length=256), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('is_penalty', sa.Boolean(), nullable=True),
    sa.Column('mark', sa.String(length=32), nullable=True),
    sa.Column('name', sa.String(length=256), nullable=True),
    sa.Column('no_control', sa.Boolean(), nullable=True),
    sa.Column('orderno', sa.Integer(), nullable=True),
    sa.Column('parent_task_id', sa.CHAR(length=64), nullable=True),
    sa.Column('period_clone_from_id', sa.CHAR(length=64), nullable=True),
    sa.Column('period_interval', sa.String(length=32), nullable=True),
    sa.Column('period_next_date', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('plan_end_date', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('plan_start_date', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('priority', sa.String(length=32), nullable=False),
    sa.Column('project_id', sa.CHAR(length=64), nullable=True),
    sa.Column('responsible_id', sa.CHAR(length=64), nullable=True),
    sa.Column('status_id', sa.CHAR(length=64), nullable=True),
    sa.Column('tags', sa.TEXT(), nullable=True),
    sa.Column('text', sa.TEXT(), nullable=True),
    sa.Column('time_estimate', sa.Integer(), nullable=True),
    sa.Column('tree_parent_id', sa.CHAR(length=64), nullable=True),
    sa.Column('type', sa.String(length=32), nullable=True),
    sa.Column('waiting_for_id', sa.CHAR(length=64), nullable=True),
    sa.ForeignKeyConstraint(['activity_id'], ['cmf_activity.id'], ),
    sa.ForeignKeyConstraint(['company_id'], ['cmf_company.id'], ),
    sa.ForeignKeyConstraint(['project_id'], ['cmf_project.id'], ),
    sa.ForeignKeyConstraint(['status_id'], ['cmf_status.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_document_code'), 'cmf_document', ['code'], unique=True)
    op.create_index(op.f('ix_cmf_document_name'), 'cmf_document', ['name'], unique=False)
    op.create_index(op.f('ix_cmf_document_orderno'), 'cmf_document', ['orderno'], unique=False)
    op.create_table('cmf_event',
    sa.Column('cmf_author_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_created_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_deleted', sa.Boolean(), nullable=False),
    sa.Column('cmf_locked_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_locked_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_modified_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_modified_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_owner_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_version', sa.Integer(), nullable=True),
    sa.Column('cmf_viewed_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('code', sa.String(length=64), nullable=True),
    sa.Column('event_alarm_date', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('event_person_id', sa.CHAR(length=64), nullable=True),
    sa.Column('event_status', sa.String(length=32), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('msg_alarm_date', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('msg_body', sa.String(length=4096), nullable=True),
    sa.Column('msg_class', sa.String(length=64), nullable=True),
    sa.Column('msg_from', sa.String(length=4096), nullable=True),
    sa.Column('msg_icon', sa.String(length=64), nullable=True),
    sa.Column('msg_important', sa.String(length=32), nullable=False),
    sa.Column('msg_orderno', sa.Integer(), nullable=True),
    sa.Column('msg_penalty', sa.Boolean(), nullable=True),
    sa.Column('msg_status', sa.String(length=64), nullable=True),
    sa.Column('msg_subject', sa.String(length=4096), nullable=True),
    sa.Column('msg_to', sa.String(length=4096), nullable=True),
    sa.Column('msg_type', sa.String(length=32), nullable=True),
    sa.Column('msg_url', sa.String(length=256), nullable=True),
    sa.Column('name', sa.String(length=256), nullable=True),
    sa.Column('object_id', sa.CHAR(length=64), nullable=True),
    sa.Column('text', sa.TEXT(), nullable=True),
    sa.Column('unread_cnt', sa.Integer(), nullable=True),
    sa.Column('view_object_id', sa.CHAR(length=64), nullable=True),
    sa.ForeignKeyConstraint(['event_person_id'], ['cmf_person.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_event_code'), 'cmf_event', ['code'], unique=True)
    op.create_index(op.f('ix_cmf_event_msg_orderno'), 'cmf_event', ['msg_orderno'], unique=False)
    op.create_index(op.f('ix_cmf_event_name'), 'cmf_event', ['name'], unique=False)
    op.create_table('cmf_role',
    sa.Column('activity_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_author_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_created_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_deleted', sa.Boolean(), nullable=False),
    sa.Column('cmf_locked_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_locked_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_modified_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_modified_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_owner_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_version', sa.Integer(), nullable=True),
    sa.Column('cmf_viewed_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('code', sa.String(length=64), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('job_id', sa.CHAR(length=64), nullable=True),
    sa.Column('job_instruction', sa.String(length=4096), nullable=True),
    sa.Column('name', sa.String(length=256), nullable=True),
    sa.Column('ou_parent_id', sa.CHAR(length=64), nullable=True),
    sa.Column('person_id', sa.CHAR(length=64), nullable=True),
    sa.Column('supervisor_id', sa.CHAR(length=64), nullable=True),
    sa.Column('text', sa.TEXT(), nullable=True),
    sa.ForeignKeyConstraint(['activity_id'], ['cmf_activity.id'], ),
    sa.ForeignKeyConstraint(['job_id'], ['cmf_job.id'], ),
    sa.ForeignKeyConstraint(['person_id'], ['cmf_person.id'], ),
    sa.ForeignKeyConstraint(['supervisor_id'], ['cmf_role.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_role_code'), 'cmf_role', ['code'], unique=True)
    op.create_index(op.f('ix_cmf_role_name'), 'cmf_role', ['name'], unique=False)
    op.create_table('cmf_u_work_chat_group',
    sa.Column('activity_id', sa.CHAR(length=64), nullable=True),
    sa.Column('alarm_date', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_author_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_created_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_deleted', sa.Boolean(), nullable=False),
    sa.Column('cmf_locked_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_locked_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_modified_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_modified_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_owner_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_version', sa.Integer(), nullable=True),
    sa.Column('cmf_viewed_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('code', sa.String(length=64), nullable=True),
    sa.Column('company_id', sa.CHAR(length=64), nullable=True),
    sa.Column('deadline', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('is_penalty', sa.Boolean(), nullable=True),
    sa.Column('mark', sa.String(length=32), nullable=True),
    sa.Column('name', sa.String(length=256), nullable=True),
    sa.Column('no_control', sa.Boolean(), nullable=True),
    sa.Column('orderno', sa.Integer(), nullable=True),
    sa.Column('p2p', sa.Boolean(), nullable=True),
    sa.Column('parent_task_id', sa.CHAR(length=64), nullable=True),
    sa.Column('period_clone_from_id', sa.CHAR(length=64), nullable=True),
    sa.Column('period_interval', sa.String(length=32), nullable=True),
    sa.Column('period_next_date', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('plan_end_date', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('plan_start_date', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('priority', sa.String(length=32), nullable=False),
    sa.Column('project_id', sa.CHAR(length=64), nullable=True),
    sa.Column('responsible_id', sa.CHAR(length=64), nullable=True),
    sa.Column('status_id', sa.CHAR(length=64), nullable=True),
    sa.Column('tags', sa.TEXT(), nullable=True),
    sa.Column('text', sa.TEXT(), nullable=True),
    sa.Column('time_estimate', sa.Integer(), nullable=True),
    sa.Column('tree_parent_id', sa.CHAR(length=64), nullable=True),
    sa.Column('waiting_for_id', sa.CHAR(length=64), nullable=True),
    sa.ForeignKeyConstraint(['activity_id'], ['cmf_activity.id'], ),
    sa.ForeignKeyConstraint(['company_id'], ['cmf_company.id'], ),
    sa.ForeignKeyConstraint(['project_id'], ['cmf_project.id'], ),
    sa.ForeignKeyConstraint(['status_id'], ['cmf_status.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_u_work_chat_group_code'), 'cmf_u_work_chat_group', ['code'], unique=True)
    op.create_index(op.f('ix_cmf_u_work_chat_group_name'), 'cmf_u_work_chat_group', ['name'], unique=False)
    op.create_index(op.f('ix_cmf_u_work_chat_group_orderno'), 'cmf_u_work_chat_group', ['orderno'], unique=False)
    op.create_table('cmf_u_work_list',
    sa.Column('activity_id', sa.CHAR(length=64), nullable=True),
    sa.Column('alarm_date', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_author_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_created_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_deleted', sa.Boolean(), nullable=False),
    sa.Column('cmf_locked_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_locked_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_modified_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_modified_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_owner_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_version', sa.Integer(), nullable=True),
    sa.Column('cmf_viewed_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('code', sa.String(length=64), nullable=True),
    sa.Column('company_id', sa.CHAR(length=64), nullable=True),
    sa.Column('deadline', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('is_penalty', sa.Boolean(), nullable=True),
    sa.Column('list_type', sa.String(length=32), nullable=False),
    sa.Column('mark', sa.String(length=32), nullable=True),
    sa.Column('name', sa.String(length=256), nullable=True),
    sa.Column('no_control', sa.Boolean(), nullable=True),
    sa.Column('orderno', sa.Integer(), nullable=True),
    sa.Column('parent_task_id', sa.CHAR(length=64), nullable=True),
    sa.Column('period_clone_from_id', sa.CHAR(length=64), nullable=True),
    sa.Column('period_interval', sa.String(length=32), nullable=True),
    sa.Column('period_next_date', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('plan_end_date', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('plan_start_date', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('priority', sa.String(length=32), nullable=False),
    sa.Column('project_id', sa.CHAR(length=64), nullable=True),
    sa.Column('responsible_id', sa.CHAR(length=64), nullable=True),
    sa.Column('status_id', sa.CHAR(length=64), nullable=True),
    sa.Column('sys_type', sa.String(length=32), nullable=True),
    sa.Column('tags', sa.TEXT(), nullable=True),
    sa.Column('text', sa.TEXT(), nullable=True),
    sa.Column('time_estimate', sa.Integer(), nullable=True),
    sa.Column('tree_parent_id', sa.CHAR(length=64), nullable=True),
    sa.Column('waiting_for_id', sa.CHAR(length=64), nullable=True),
    sa.ForeignKeyConstraint(['activity_id'], ['cmf_activity.id'], ),
    sa.ForeignKeyConstraint(['company_id'], ['cmf_company.id'], ),
    sa.ForeignKeyConstraint(['project_id'], ['cmf_project.id'], ),
    sa.ForeignKeyConstraint(['status_id'], ['cmf_status.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_u_work_list_code'), 'cmf_u_work_list', ['code'], unique=True)
    op.create_index(op.f('ix_cmf_u_work_list_name'), 'cmf_u_work_list', ['name'], unique=False)
    op.create_index(op.f('ix_cmf_u_work_list_orderno'), 'cmf_u_work_list', ['orderno'], unique=False)
    op.create_table('cmf_u_work_post',
    sa.Column('activity_id', sa.CHAR(length=64), nullable=True),
    sa.Column('alarm_date', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_author_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_created_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_deleted', sa.Boolean(), nullable=False),
    sa.Column('cmf_locked_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_locked_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_modified_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_modified_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_owner_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_version', sa.Integer(), nullable=True),
    sa.Column('cmf_viewed_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('code', sa.String(length=64), nullable=True),
    sa.Column('company_id', sa.CHAR(length=64), nullable=True),
    sa.Column('deadline', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('is_penalty', sa.Boolean(), nullable=True),
    sa.Column('mark', sa.String(length=32), nullable=True),
    sa.Column('name', sa.String(length=256), nullable=True),
    sa.Column('no_control', sa.Boolean(), nullable=True),
    sa.Column('orderno', sa.Integer(), nullable=True),
    sa.Column('parent_task_id', sa.CHAR(length=64), nullable=True),
    sa.Column('period_clone_from_id', sa.CHAR(length=64), nullable=True),
    sa.Column('period_interval', sa.String(length=32), nullable=True),
    sa.Column('period_next_date', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('plan_end_date', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('plan_start_date', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('priority', sa.String(length=32), nullable=False),
    sa.Column('project_id', sa.CHAR(length=64), nullable=True),
    sa.Column('responsible_id', sa.CHAR(length=64), nullable=True),
    sa.Column('status_id', sa.CHAR(length=64), nullable=True),
    sa.Column('tags', sa.TEXT(), nullable=True),
    sa.Column('text', sa.TEXT(), nullable=True),
    sa.Column('time_estimate', sa.Integer(), nullable=True),
    sa.Column('tree_parent_id', sa.CHAR(length=64), nullable=True),
    sa.Column('waiting_for_id', sa.CHAR(length=64), nullable=True),
    sa.ForeignKeyConstraint(['activity_id'], ['cmf_activity.id'], ),
    sa.ForeignKeyConstraint(['company_id'], ['cmf_company.id'], ),
    sa.ForeignKeyConstraint(['project_id'], ['cmf_project.id'], ),
    sa.ForeignKeyConstraint(['status_id'], ['cmf_status.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_u_work_post_code'), 'cmf_u_work_post', ['code'], unique=True)
    op.create_index(op.f('ix_cmf_u_work_post_name'), 'cmf_u_work_post', ['name'], unique=False)
    op.create_index(op.f('ix_cmf_u_work_post_orderno'), 'cmf_u_work_post', ['orderno'], unique=False)
    op.create_table('cmf_u_work_task',
    sa.Column('activity_id', sa.CHAR(length=64), nullable=True),
    sa.Column('alarm_date', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_author_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_created_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_deleted', sa.Boolean(), nullable=False),
    sa.Column('cmf_locked_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_locked_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_modified_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_modified_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_owner_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_version', sa.Integer(), nullable=True),
    sa.Column('cmf_viewed_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('code', sa.String(length=64), nullable=True),
    sa.Column('company_id', sa.CHAR(length=64), nullable=True),
    sa.Column('deadline', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('is_penalty', sa.Boolean(), nullable=True),
    sa.Column('mark', sa.String(length=32), nullable=True),
    sa.Column('name', sa.String(length=256), nullable=True),
    sa.Column('no_control', sa.Boolean(), nullable=True),
    sa.Column('orderno', sa.Integer(), nullable=True),
    sa.Column('parent_task_id', sa.CHAR(length=64), nullable=True),
    sa.Column('period_clone_from_id', sa.CHAR(length=64), nullable=True),
    sa.Column('period_interval', sa.String(length=32), nullable=True),
    sa.Column('period_next_date', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('plan_end_date', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('plan_start_date', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('priority', sa.String(length=32), nullable=False),
    sa.Column('project_id', sa.CHAR(length=64), nullable=True),
    sa.Column('responsible_id', sa.CHAR(length=64), nullable=True),
    sa.Column('status_id', sa.CHAR(length=64), nullable=True),
    sa.Column('tags', sa.TEXT(), nullable=True),
    sa.Column('text', sa.TEXT(), nullable=True),
    sa.Column('time_estimate', sa.Integer(), nullable=True),
    sa.Column('tree_parent_id', sa.CHAR(length=64), nullable=True),
    sa.Column('uwork_type_id', sa.CHAR(length=64), nullable=True),
    sa.Column('waiting_for_id', sa.CHAR(length=64), nullable=True),
    sa.ForeignKeyConstraint(['activity_id'], ['cmf_activity.id'], ),
    sa.ForeignKeyConstraint(['company_id'], ['cmf_company.id'], ),
    sa.ForeignKeyConstraint(['project_id'], ['cmf_project.id'], ),
    sa.ForeignKeyConstraint(['status_id'], ['cmf_status.id'], ),
    sa.ForeignKeyConstraint(['uwork_type_id'], ['cmf_u_work_type.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_u_work_task_code'), 'cmf_u_work_task', ['code'], unique=True)
    op.create_index(op.f('ix_cmf_u_work_task_name'), 'cmf_u_work_task', ['name'], unique=False)
    op.create_index(op.f('ix_cmf_u_work_task_orderno'), 'cmf_u_work_task', ['orderno'], unique=False)
    op.create_table('cmf_feed_cmf_event',
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('left_id', sa.CHAR(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('right_id', sa.CHAR(length=64), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.ForeignKeyConstraint(['left_id'], ['cmf_feed.id'], ),
    sa.ForeignKeyConstraint(['right_id'], ['cmf_event.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('cmf_org_unit',
    sa.Column('cmf_author_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_created_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_deleted', sa.Boolean(), nullable=False),
    sa.Column('cmf_locked_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_locked_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_modified_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_modified_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_owner_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_version', sa.Integer(), nullable=True),
    sa.Column('cmf_viewed_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('code', sa.String(length=64), nullable=True),
    sa.Column('head_id', sa.CHAR(length=64), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('name', sa.String(length=256), nullable=True),
    sa.Column('ou_parent_id', sa.CHAR(length=64), nullable=True),
    sa.Column('text', sa.TEXT(), nullable=True),
    sa.ForeignKeyConstraint(['head_id'], ['cmf_role.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_org_unit_code'), 'cmf_org_unit', ['code'], unique=True)
    op.create_index(op.f('ix_cmf_org_unit_name'), 'cmf_org_unit', ['name'], unique=False)
    op.create_table('cmf_person_group',
    sa.Column('cmf_author_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_created_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_deleted', sa.Boolean(), nullable=False),
    sa.Column('cmf_locked_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_locked_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_modified_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_modified_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_owner_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_version', sa.Integer(), nullable=True),
    sa.Column('cmf_viewed_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('code', sa.String(length=64), nullable=True),
    sa.Column('head_id', sa.CHAR(length=64), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('name', sa.String(length=256), nullable=True),
    sa.Column('text', sa.TEXT(), nullable=True),
    sa.ForeignKeyConstraint(['head_id'], ['cmf_role.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_person_group_code'), 'cmf_person_group', ['code'], unique=True)
    op.create_index(op.f('ix_cmf_person_group_name'), 'cmf_person_group', ['name'], unique=False)
    op.create_table('cmf_u_work_chat_topic',
    sa.Column('activity_id', sa.CHAR(length=64), nullable=True),
    sa.Column('alarm_date', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_author_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_created_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_deleted', sa.Boolean(), nullable=False),
    sa.Column('cmf_locked_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_locked_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_modified_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_modified_by_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_owner_id', sa.CHAR(length=64), nullable=True),
    sa.Column('cmf_version', sa.Integer(), nullable=True),
    sa.Column('cmf_viewed_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('code', sa.String(length=64), nullable=True),
    sa.Column('company_id', sa.CHAR(length=64), nullable=True),
    sa.Column('deadline', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('group_id', sa.CHAR(length=64), nullable=True),
    sa.Column('id', sa.CHAR(length=64), nullable=False),
    sa.Column('is_penalty', sa.Boolean(), nullable=True),
    sa.Column('mark', sa.String(length=32), nullable=True),
    sa.Column('name', sa.String(length=256), nullable=True),
    sa.Column('no_control', sa.Boolean(), nullable=True),
    sa.Column('orderno', sa.Integer(), nullable=True),
    sa.Column('parent_task_id', sa.CHAR(length=64), nullable=True),
    sa.Column('period_clone_from_id', sa.CHAR(length=64), nullable=True),
    sa.Column('period_interval', sa.String(length=32), nullable=True),
    sa.Column('period_next_date', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('plan_end_date', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('plan_start_date', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('priority', sa.String(length=32), nullable=False),
    sa.Column('project_id', sa.CHAR(length=64), nullable=True),
    sa.Column('responsible_id', sa.CHAR(length=64), nullable=True),
    sa.Column('status_id', sa.CHAR(length=64), nullable=True),
    sa.Column('tags', sa.TEXT(), nullable=True),
    sa.Column('text', sa.TEXT(), nullable=True),
    sa.Column('time_estimate', sa.Integer(), nullable=True),
    sa.Column('tree_parent_id', sa.CHAR(length=64), nullable=True),
    sa.Column('waiting_for_id', sa.CHAR(length=64), nullable=True),
    sa.ForeignKeyConstraint(['activity_id'], ['cmf_activity.id'], ),
    sa.ForeignKeyConstraint(['company_id'], ['cmf_company.id'], ),
    sa.ForeignKeyConstraint(['group_id'], ['cmf_u_work_chat_group.id'], ),
    sa.ForeignKeyConstraint(['project_id'], ['cmf_project.id'], ),
    sa.ForeignKeyConstraint(['status_id'], ['cmf_status.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_u_work_chat_topic_code'), 'cmf_u_work_chat_topic', ['code'], unique=True)
    op.create_index(op.f('ix_cmf_u_work_chat_topic_name'), 'cmf_u_work_chat_topic', ['name'], unique=False)
    op.create_index(op.f('ix_cmf_u_work_chat_topic_orderno'), 'cmf_u_work_chat_topic', ['orderno'], unique=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_cmf_u_work_chat_topic_orderno'), table_name='cmf_u_work_chat_topic')
    op.drop_index(op.f('ix_cmf_u_work_chat_topic_name'), table_name='cmf_u_work_chat_topic')
    op.drop_index(op.f('ix_cmf_u_work_chat_topic_code'), table_name='cmf_u_work_chat_topic')
    op.drop_table('cmf_u_work_chat_topic')
    op.drop_index(op.f('ix_cmf_person_group_name'), table_name='cmf_person_group')
    op.drop_index(op.f('ix_cmf_person_group_code'), table_name='cmf_person_group')
    op.drop_table('cmf_person_group')
    op.drop_index(op.f('ix_cmf_org_unit_name'), table_name='cmf_org_unit')
    op.drop_index(op.f('ix_cmf_org_unit_code'), table_name='cmf_org_unit')
    op.drop_table('cmf_org_unit')
    op.drop_table('cmf_feed_cmf_event')
    op.drop_index(op.f('ix_cmf_u_work_task_orderno'), table_name='cmf_u_work_task')
    op.drop_index(op.f('ix_cmf_u_work_task_name'), table_name='cmf_u_work_task')
    op.drop_index(op.f('ix_cmf_u_work_task_code'), table_name='cmf_u_work_task')
    op.drop_table('cmf_u_work_task')
    op.drop_index(op.f('ix_cmf_u_work_post_orderno'), table_name='cmf_u_work_post')
    op.drop_index(op.f('ix_cmf_u_work_post_name'), table_name='cmf_u_work_post')
    op.drop_index(op.f('ix_cmf_u_work_post_code'), table_name='cmf_u_work_post')
    op.drop_table('cmf_u_work_post')
    op.drop_index(op.f('ix_cmf_u_work_list_orderno'), table_name='cmf_u_work_list')
    op.drop_index(op.f('ix_cmf_u_work_list_name'), table_name='cmf_u_work_list')
    op.drop_index(op.f('ix_cmf_u_work_list_code'), table_name='cmf_u_work_list')
    op.drop_table('cmf_u_work_list')
    op.drop_index(op.f('ix_cmf_u_work_chat_group_orderno'), table_name='cmf_u_work_chat_group')
    op.drop_index(op.f('ix_cmf_u_work_chat_group_name'), table_name='cmf_u_work_chat_group')
    op.drop_index(op.f('ix_cmf_u_work_chat_group_code'), table_name='cmf_u_work_chat_group')
    op.drop_table('cmf_u_work_chat_group')
    op.drop_index(op.f('ix_cmf_role_name'), table_name='cmf_role')
    op.drop_index(op.f('ix_cmf_role_code'), table_name='cmf_role')
    op.drop_table('cmf_role')
    op.drop_index(op.f('ix_cmf_event_name'), table_name='cmf_event')
    op.drop_index(op.f('ix_cmf_event_msg_orderno'), table_name='cmf_event')
    op.drop_index(op.f('ix_cmf_event_code'), table_name='cmf_event')
    op.drop_table('cmf_event')
    op.drop_index(op.f('ix_cmf_document_orderno'), table_name='cmf_document')
    op.drop_index(op.f('ix_cmf_document_name'), table_name='cmf_document')
    op.drop_index(op.f('ix_cmf_document_code'), table_name='cmf_document')
    op.drop_table('cmf_document')
    op.drop_index(op.f('ix_cmf_u_work_type_name'), table_name='cmf_u_work_type')
    op.drop_index(op.f('ix_cmf_u_work_type_code'), table_name='cmf_u_work_type')
    op.drop_table('cmf_u_work_type')
    op.drop_index(op.f('ix_cmf_status_name'), table_name='cmf_status')
    op.drop_index(op.f('ix_cmf_status_code'), table_name='cmf_status')
    op.drop_table('cmf_status')
    op.drop_index(op.f('ix_cmf_person_uid'), table_name='cmf_person')
    op.drop_index(op.f('ix_cmf_person_name'), table_name='cmf_person')
    op.drop_index(op.f('ix_cmf_person_login'), table_name='cmf_person')
    op.drop_index(op.f('ix_cmf_person_code'), table_name='cmf_person')
    op.drop_table('cmf_person')
    op.drop_index(op.f('ix_cmf_folder_orderno'), table_name='cmf_folder')
    op.drop_index(op.f('ix_cmf_folder_name'), table_name='cmf_folder')
    op.drop_index(op.f('ix_cmf_folder_code'), table_name='cmf_folder')
    op.drop_table('cmf_folder')
    op.drop_table('cmf_u_work_task_spectators')
    op.drop_table('cmf_u_work_task_related_objects')
    op.drop_table('cmf_u_work_task_executors')
    op.drop_table('cmf_u_work_post_spectators')
    op.drop_table('cmf_u_work_post_related_objects')
    op.drop_table('cmf_u_work_post_executors')
    op.drop_table('cmf_u_work_list_spectators')
    op.drop_table('cmf_u_work_list_related_objects')
    op.drop_table('cmf_u_work_list_members')
    op.drop_table('cmf_u_work_list_executors')
    op.drop_table('cmf_u_work_chat_topic_spectators')
    op.drop_table('cmf_u_work_chat_topic_related_objects')
    op.drop_table('cmf_u_work_chat_topic_executors')
    op.drop_table('cmf_u_work_chat_group_spectators')
    op.drop_table('cmf_u_work_chat_group_related_objects')
    op.drop_table('cmf_u_work_chat_group_executors')
    op.drop_table('cmf_project_spectators')
    op.drop_table('cmf_project_executors')
    op.drop_index(op.f('ix_cmf_project_name'), table_name='cmf_project')
    op.drop_index(op.f('ix_cmf_project_code'), table_name='cmf_project')
    op.drop_table('cmf_project')
    op.drop_index(op.f('ix_cmf_plan_name'), table_name='cmf_plan')
    op.drop_index(op.f('ix_cmf_plan_code'), table_name='cmf_plan')
    op.drop_table('cmf_plan')
    op.drop_table('cmf_person_group_rg_members')
    op.drop_index(op.f('ix_cmf_job_name'), table_name='cmf_job')
    op.drop_index(op.f('ix_cmf_job_code'), table_name='cmf_job')
    op.drop_table('cmf_job')
    op.drop_index(op.f('ix_cmf_feed_orderno'), table_name='cmf_feed')
    op.drop_index(op.f('ix_cmf_feed_name'), table_name='cmf_feed')
    op.drop_index(op.f('ix_cmf_feed_code'), table_name='cmf_feed')
    op.drop_table('cmf_feed')
    op.drop_table('cmf_document_spectators')
    op.drop_table('cmf_document_related_objects')
    op.drop_table('cmf_document_executors')
    op.drop_index(op.f('ix_cmf_company_name'), table_name='cmf_company')
    op.drop_index(op.f('ix_cmf_company_code'), table_name='cmf_company')
    op.drop_table('cmf_company')
    op.drop_index(op.f('ix_cmf_comment_name'), table_name='cmf_comment')
    op.drop_index(op.f('ix_cmf_comment_code'), table_name='cmf_comment')
    op.drop_table('cmf_comment')
    op.drop_index(op.f('ix_cmf_auth_posix_uid'), table_name='cmf_auth')
    op.drop_index(op.f('ix_cmf_auth_posix_gid'), table_name='cmf_auth')
    op.drop_index(op.f('ix_cmf_auth_name'), table_name='cmf_auth')
    op.drop_index(op.f('ix_cmf_auth_login'), table_name='cmf_auth')
    op.drop_index(op.f('ix_cmf_auth_email'), table_name='cmf_auth')
    op.drop_table('cmf_auth')
    op.drop_index(op.f('ix_cmf_attachment_name'), table_name='cmf_attachment')
    op.drop_index(op.f('ix_cmf_attachment_code'), table_name='cmf_attachment')
    op.drop_table('cmf_attachment')
    op.drop_index(op.f('ix_cmf_activity_name'), table_name='cmf_activity')
    op.drop_index(op.f('ix_cmf_activity_code'), table_name='cmf_activity')
    op.drop_table('cmf_activity')
    # ### end Alembic commands ###
