"""parent_objects tasks documents

Revision ID: f58a6cbea1a9
Revises: a38c9f6ae8ab
Create Date: 2021-03-10 15:59:07.994629

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'f58a6cbea1a9'
down_revision = 'a38c9f6ae8ab'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('cmf_chat_group_parent_objects',
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('id', sa.String(length=64), nullable=False),
    sa.Column('left_id', sa.String(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('parent_id', sa.String(length=64), nullable=True),
    sa.Column('right_id', sa.String(length=64), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.Column('root_id', sa.String(length=64), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_chat_group_parent_objects_left_id'), 'cmf_chat_group_parent_objects', ['left_id'], unique=False)
    op.create_index(op.f('ix_cmf_chat_group_parent_objects_parent_id'), 'cmf_chat_group_parent_objects', ['parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_chat_group_parent_objects_right_id'), 'cmf_chat_group_parent_objects', ['right_id'], unique=False)
    op.create_index(op.f('ix_cmf_chat_group_parent_objects_root_id'), 'cmf_chat_group_parent_objects', ['root_id'], unique=False)
    op.create_table('cmf_chat_topic_parent_objects',
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('id', sa.String(length=64), nullable=False),
    sa.Column('left_id', sa.String(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('parent_id', sa.String(length=64), nullable=True),
    sa.Column('right_id', sa.String(length=64), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.Column('root_id', sa.String(length=64), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_chat_topic_parent_objects_left_id'), 'cmf_chat_topic_parent_objects', ['left_id'], unique=False)
    op.create_index(op.f('ix_cmf_chat_topic_parent_objects_parent_id'), 'cmf_chat_topic_parent_objects', ['parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_chat_topic_parent_objects_right_id'), 'cmf_chat_topic_parent_objects', ['right_id'], unique=False)
    op.create_index(op.f('ix_cmf_chat_topic_parent_objects_root_id'), 'cmf_chat_topic_parent_objects', ['root_id'], unique=False)
    op.create_table('cmf_company_parent_objects',
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('id', sa.String(length=64), nullable=False),
    sa.Column('left_id', sa.String(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('parent_id', sa.String(length=64), nullable=True),
    sa.Column('right_id', sa.String(length=64), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.Column('root_id', sa.String(length=64), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_company_parent_objects_left_id'), 'cmf_company_parent_objects', ['left_id'], unique=False)
    op.create_index(op.f('ix_cmf_company_parent_objects_parent_id'), 'cmf_company_parent_objects', ['parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_company_parent_objects_right_id'), 'cmf_company_parent_objects', ['right_id'], unique=False)
    op.create_index(op.f('ix_cmf_company_parent_objects_root_id'), 'cmf_company_parent_objects', ['root_id'], unique=False)
    op.create_table('cmf_deal_parent_objects',
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('id', sa.String(length=64), nullable=False),
    sa.Column('left_id', sa.String(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('parent_id', sa.String(length=64), nullable=True),
    sa.Column('right_id', sa.String(length=64), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.Column('root_id', sa.String(length=64), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_deal_parent_objects_left_id'), 'cmf_deal_parent_objects', ['left_id'], unique=False)
    op.create_index(op.f('ix_cmf_deal_parent_objects_parent_id'), 'cmf_deal_parent_objects', ['parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_deal_parent_objects_right_id'), 'cmf_deal_parent_objects', ['right_id'], unique=False)
    op.create_index(op.f('ix_cmf_deal_parent_objects_root_id'), 'cmf_deal_parent_objects', ['root_id'], unique=False)
    op.create_table('cmf_document_parent_objects',
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('id', sa.String(length=64), nullable=False),
    sa.Column('left_id', sa.String(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('parent_id', sa.String(length=64), nullable=True),
    sa.Column('right_id', sa.String(length=64), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.Column('root_id', sa.String(length=64), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_document_parent_objects_left_id'), 'cmf_document_parent_objects', ['left_id'], unique=False)
    op.create_index(op.f('ix_cmf_document_parent_objects_parent_id'), 'cmf_document_parent_objects', ['parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_document_parent_objects_right_id'), 'cmf_document_parent_objects', ['right_id'], unique=False)
    op.create_index(op.f('ix_cmf_document_parent_objects_root_id'), 'cmf_document_parent_objects', ['root_id'], unique=False)
    op.create_table('cmf_invoice_parent_objects',
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('id', sa.String(length=64), nullable=False),
    sa.Column('left_id', sa.String(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('parent_id', sa.String(length=64), nullable=True),
    sa.Column('right_id', sa.String(length=64), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.Column('root_id', sa.String(length=64), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_invoice_parent_objects_left_id'), 'cmf_invoice_parent_objects', ['left_id'], unique=False)
    op.create_index(op.f('ix_cmf_invoice_parent_objects_parent_id'), 'cmf_invoice_parent_objects', ['parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_invoice_parent_objects_right_id'), 'cmf_invoice_parent_objects', ['right_id'], unique=False)
    op.create_index(op.f('ix_cmf_invoice_parent_objects_root_id'), 'cmf_invoice_parent_objects', ['root_id'], unique=False)
    op.create_table('cmf_lead_parent_objects',
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('id', sa.String(length=64), nullable=False),
    sa.Column('left_id', sa.String(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('parent_id', sa.String(length=64), nullable=True),
    sa.Column('right_id', sa.String(length=64), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.Column('root_id', sa.String(length=64), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_lead_parent_objects_left_id'), 'cmf_lead_parent_objects', ['left_id'], unique=False)
    op.create_index(op.f('ix_cmf_lead_parent_objects_parent_id'), 'cmf_lead_parent_objects', ['parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_lead_parent_objects_right_id'), 'cmf_lead_parent_objects', ['right_id'], unique=False)
    op.create_index(op.f('ix_cmf_lead_parent_objects_root_id'), 'cmf_lead_parent_objects', ['root_id'], unique=False)
    op.create_table('cmf_list_parent_objects',
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('id', sa.String(length=64), nullable=False),
    sa.Column('left_id', sa.String(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('parent_id', sa.String(length=64), nullable=True),
    sa.Column('right_id', sa.String(length=64), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.Column('root_id', sa.String(length=64), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_list_parent_objects_left_id'), 'cmf_list_parent_objects', ['left_id'], unique=False)
    op.create_index(op.f('ix_cmf_list_parent_objects_parent_id'), 'cmf_list_parent_objects', ['parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_list_parent_objects_right_id'), 'cmf_list_parent_objects', ['right_id'], unique=False)
    op.create_index(op.f('ix_cmf_list_parent_objects_root_id'), 'cmf_list_parent_objects', ['root_id'], unique=False)
    op.create_table('cmf_mail_parent_objects',
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('id', sa.String(length=64), nullable=False),
    sa.Column('left_id', sa.String(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('parent_id', sa.String(length=64), nullable=True),
    sa.Column('right_id', sa.String(length=64), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.Column('root_id', sa.String(length=64), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_mail_parent_objects_left_id'), 'cmf_mail_parent_objects', ['left_id'], unique=False)
    op.create_index(op.f('ix_cmf_mail_parent_objects_parent_id'), 'cmf_mail_parent_objects', ['parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_mail_parent_objects_right_id'), 'cmf_mail_parent_objects', ['right_id'], unique=False)
    op.create_index(op.f('ix_cmf_mail_parent_objects_root_id'), 'cmf_mail_parent_objects', ['root_id'], unique=False)
    op.create_table('cmf_payment_parent_objects',
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('id', sa.String(length=64), nullable=False),
    sa.Column('left_id', sa.String(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('parent_id', sa.String(length=64), nullable=True),
    sa.Column('right_id', sa.String(length=64), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.Column('root_id', sa.String(length=64), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_payment_parent_objects_left_id'), 'cmf_payment_parent_objects', ['left_id'], unique=False)
    op.create_index(op.f('ix_cmf_payment_parent_objects_parent_id'), 'cmf_payment_parent_objects', ['parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_payment_parent_objects_right_id'), 'cmf_payment_parent_objects', ['right_id'], unique=False)
    op.create_index(op.f('ix_cmf_payment_parent_objects_root_id'), 'cmf_payment_parent_objects', ['root_id'], unique=False)
    op.create_table('cmf_pipeline_parent_objects',
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('id', sa.String(length=64), nullable=False),
    sa.Column('left_id', sa.String(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('parent_id', sa.String(length=64), nullable=True),
    sa.Column('right_id', sa.String(length=64), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.Column('root_id', sa.String(length=64), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_pipeline_parent_objects_left_id'), 'cmf_pipeline_parent_objects', ['left_id'], unique=False)
    op.create_index(op.f('ix_cmf_pipeline_parent_objects_parent_id'), 'cmf_pipeline_parent_objects', ['parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_pipeline_parent_objects_right_id'), 'cmf_pipeline_parent_objects', ['right_id'], unique=False)
    op.create_index(op.f('ix_cmf_pipeline_parent_objects_root_id'), 'cmf_pipeline_parent_objects', ['root_id'], unique=False)
    op.create_table('cmf_purchase_order_items_parent_objects',
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('id', sa.String(length=64), nullable=False),
    sa.Column('left_id', sa.String(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('parent_id', sa.String(length=64), nullable=True),
    sa.Column('right_id', sa.String(length=64), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.Column('root_id', sa.String(length=64), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_purchase_order_items_parent_objects_left_id'), 'cmf_purchase_order_items_parent_objects', ['left_id'], unique=False)
    op.create_index(op.f('ix_cmf_purchase_order_items_parent_objects_parent_id'), 'cmf_purchase_order_items_parent_objects', ['parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_purchase_order_items_parent_objects_right_id'), 'cmf_purchase_order_items_parent_objects', ['right_id'], unique=False)
    op.create_index(op.f('ix_cmf_purchase_order_items_parent_objects_root_id'), 'cmf_purchase_order_items_parent_objects', ['root_id'], unique=False)
    op.create_table('cmf_purchase_order_parent_objects',
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('id', sa.String(length=64), nullable=False),
    sa.Column('left_id', sa.String(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('parent_id', sa.String(length=64), nullable=True),
    sa.Column('right_id', sa.String(length=64), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.Column('root_id', sa.String(length=64), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_purchase_order_parent_objects_left_id'), 'cmf_purchase_order_parent_objects', ['left_id'], unique=False)
    op.create_index(op.f('ix_cmf_purchase_order_parent_objects_parent_id'), 'cmf_purchase_order_parent_objects', ['parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_purchase_order_parent_objects_right_id'), 'cmf_purchase_order_parent_objects', ['right_id'], unique=False)
    op.create_index(op.f('ix_cmf_purchase_order_parent_objects_root_id'), 'cmf_purchase_order_parent_objects', ['root_id'], unique=False)
    op.create_table('cmf_sales_order_parent_objects',
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('id', sa.String(length=64), nullable=False),
    sa.Column('left_id', sa.String(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('parent_id', sa.String(length=64), nullable=True),
    sa.Column('right_id', sa.String(length=64), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.Column('root_id', sa.String(length=64), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_sales_order_parent_objects_left_id'), 'cmf_sales_order_parent_objects', ['left_id'], unique=False)
    op.create_index(op.f('ix_cmf_sales_order_parent_objects_parent_id'), 'cmf_sales_order_parent_objects', ['parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_sales_order_parent_objects_right_id'), 'cmf_sales_order_parent_objects', ['right_id'], unique=False)
    op.create_index(op.f('ix_cmf_sales_order_parent_objects_root_id'), 'cmf_sales_order_parent_objects', ['root_id'], unique=False)
    op.create_table('cmf_stock_move_items_parent_objects',
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('id', sa.String(length=64), nullable=False),
    sa.Column('left_id', sa.String(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('parent_id', sa.String(length=64), nullable=True),
    sa.Column('right_id', sa.String(length=64), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.Column('root_id', sa.String(length=64), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_stock_move_items_parent_objects_left_id'), 'cmf_stock_move_items_parent_objects', ['left_id'], unique=False)
    op.create_index(op.f('ix_cmf_stock_move_items_parent_objects_parent_id'), 'cmf_stock_move_items_parent_objects', ['parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_stock_move_items_parent_objects_right_id'), 'cmf_stock_move_items_parent_objects', ['right_id'], unique=False)
    op.create_index(op.f('ix_cmf_stock_move_items_parent_objects_root_id'), 'cmf_stock_move_items_parent_objects', ['root_id'], unique=False)
    op.create_table('cmf_stock_move_parent_objects',
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('id', sa.String(length=64), nullable=False),
    sa.Column('left_id', sa.String(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('parent_id', sa.String(length=64), nullable=True),
    sa.Column('right_id', sa.String(length=64), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.Column('root_id', sa.String(length=64), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_stock_move_parent_objects_left_id'), 'cmf_stock_move_parent_objects', ['left_id'], unique=False)
    op.create_index(op.f('ix_cmf_stock_move_parent_objects_parent_id'), 'cmf_stock_move_parent_objects', ['parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_stock_move_parent_objects_right_id'), 'cmf_stock_move_parent_objects', ['right_id'], unique=False)
    op.create_index(op.f('ix_cmf_stock_move_parent_objects_root_id'), 'cmf_stock_move_parent_objects', ['root_id'], unique=False)
    op.create_table('cmf_task_parent_objects',
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('id', sa.String(length=64), nullable=False),
    sa.Column('left_id', sa.String(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('parent_id', sa.String(length=64), nullable=True),
    sa.Column('right_id', sa.String(length=64), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.Column('root_id', sa.String(length=64), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_task_parent_objects_left_id'), 'cmf_task_parent_objects', ['left_id'], unique=False)
    op.create_index(op.f('ix_cmf_task_parent_objects_parent_id'), 'cmf_task_parent_objects', ['parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_task_parent_objects_right_id'), 'cmf_task_parent_objects', ['right_id'], unique=False)
    op.create_index(op.f('ix_cmf_task_parent_objects_root_id'), 'cmf_task_parent_objects', ['root_id'], unique=False)
    op.create_table('cmf_u_work_post_parent_objects',
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('id', sa.String(length=64), nullable=False),
    sa.Column('left_id', sa.String(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('parent_id', sa.String(length=64), nullable=True),
    sa.Column('right_id', sa.String(length=64), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.Column('root_id', sa.String(length=64), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_u_work_post_parent_objects_left_id'), 'cmf_u_work_post_parent_objects', ['left_id'], unique=False)
    op.create_index(op.f('ix_cmf_u_work_post_parent_objects_parent_id'), 'cmf_u_work_post_parent_objects', ['parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_u_work_post_parent_objects_right_id'), 'cmf_u_work_post_parent_objects', ['right_id'], unique=False)
    op.create_index(op.f('ix_cmf_u_work_post_parent_objects_root_id'), 'cmf_u_work_post_parent_objects', ['root_id'], unique=False)
    op.drop_index('ix_cmf_task_related_objects_left_id', table_name='cmf_task_related_objects')
    op.drop_index('ix_cmf_task_related_objects_parent_id', table_name='cmf_task_related_objects')
    op.drop_index('ix_cmf_task_related_objects_right_id', table_name='cmf_task_related_objects')
    op.drop_index('ix_cmf_task_related_objects_root_id', table_name='cmf_task_related_objects')
    op.drop_table('cmf_task_related_objects')
    op.drop_index('ix_cmf_u_work_post_related_objects_left_id', table_name='cmf_u_work_post_related_objects')
    op.drop_index('ix_cmf_u_work_post_related_objects_parent_id', table_name='cmf_u_work_post_related_objects')
    op.drop_index('ix_cmf_u_work_post_related_objects_right_id', table_name='cmf_u_work_post_related_objects')
    op.drop_index('ix_cmf_u_work_post_related_objects_root_id', table_name='cmf_u_work_post_related_objects')
    op.drop_table('cmf_u_work_post_related_objects')
    op.drop_index('ix_cmf_purchase_order_items_related_objects_left_id', table_name='cmf_purchase_order_items_related_objects')
    op.drop_index('ix_cmf_purchase_order_items_related_objects_parent_id', table_name='cmf_purchase_order_items_related_objects')
    op.drop_index('ix_cmf_purchase_order_items_related_objects_right_id', table_name='cmf_purchase_order_items_related_objects')
    op.drop_index('ix_cmf_purchase_order_items_related_objects_root_id', table_name='cmf_purchase_order_items_related_objects')
    op.drop_table('cmf_purchase_order_items_related_objects')
    op.drop_index('ix_cmf_company_related_objects_left_id', table_name='cmf_company_related_objects')
    op.drop_index('ix_cmf_company_related_objects_parent_id', table_name='cmf_company_related_objects')
    op.drop_index('ix_cmf_company_related_objects_right_id', table_name='cmf_company_related_objects')
    op.drop_index('ix_cmf_company_related_objects_root_id', table_name='cmf_company_related_objects')
    op.drop_table('cmf_company_related_objects')
    op.drop_index('ix_cmf_purchase_order_related_objects_left_id', table_name='cmf_purchase_order_related_objects')
    op.drop_index('ix_cmf_purchase_order_related_objects_parent_id', table_name='cmf_purchase_order_related_objects')
    op.drop_index('ix_cmf_purchase_order_related_objects_right_id', table_name='cmf_purchase_order_related_objects')
    op.drop_index('ix_cmf_purchase_order_related_objects_root_id', table_name='cmf_purchase_order_related_objects')
    op.drop_table('cmf_purchase_order_related_objects')
    op.drop_index('ix_cmf_list_related_objects_left_id', table_name='cmf_list_related_objects')
    op.drop_index('ix_cmf_list_related_objects_parent_id', table_name='cmf_list_related_objects')
    op.drop_index('ix_cmf_list_related_objects_right_id', table_name='cmf_list_related_objects')
    op.drop_index('ix_cmf_list_related_objects_root_id', table_name='cmf_list_related_objects')
    op.drop_table('cmf_list_related_objects')
    op.drop_index('ix_cmf_deal_related_objects_left_id', table_name='cmf_deal_related_objects')
    op.drop_index('ix_cmf_deal_related_objects_parent_id', table_name='cmf_deal_related_objects')
    op.drop_index('ix_cmf_deal_related_objects_right_id', table_name='cmf_deal_related_objects')
    op.drop_index('ix_cmf_deal_related_objects_root_id', table_name='cmf_deal_related_objects')
    op.drop_table('cmf_deal_related_objects')
    op.drop_index('ix_cmf_stock_move_items_related_objects_left_id', table_name='cmf_stock_move_items_related_objects')
    op.drop_index('ix_cmf_stock_move_items_related_objects_parent_id', table_name='cmf_stock_move_items_related_objects')
    op.drop_index('ix_cmf_stock_move_items_related_objects_right_id', table_name='cmf_stock_move_items_related_objects')
    op.drop_index('ix_cmf_stock_move_items_related_objects_root_id', table_name='cmf_stock_move_items_related_objects')
    op.drop_table('cmf_stock_move_items_related_objects')
    op.drop_index('ix_cmf_stock_move_related_objects_left_id', table_name='cmf_stock_move_related_objects')
    op.drop_index('ix_cmf_stock_move_related_objects_parent_id', table_name='cmf_stock_move_related_objects')
    op.drop_index('ix_cmf_stock_move_related_objects_right_id', table_name='cmf_stock_move_related_objects')
    op.drop_index('ix_cmf_stock_move_related_objects_root_id', table_name='cmf_stock_move_related_objects')
    op.drop_table('cmf_stock_move_related_objects')
    op.drop_index('ix_cmf_payment_related_objects_left_id', table_name='cmf_payment_related_objects')
    op.drop_index('ix_cmf_payment_related_objects_parent_id', table_name='cmf_payment_related_objects')
    op.drop_index('ix_cmf_payment_related_objects_right_id', table_name='cmf_payment_related_objects')
    op.drop_index('ix_cmf_payment_related_objects_root_id', table_name='cmf_payment_related_objects')
    op.drop_table('cmf_payment_related_objects')
    op.drop_index('ix_cmf_chat_topic_related_objects_left_id', table_name='cmf_chat_topic_related_objects')
    op.drop_index('ix_cmf_chat_topic_related_objects_parent_id', table_name='cmf_chat_topic_related_objects')
    op.drop_index('ix_cmf_chat_topic_related_objects_right_id', table_name='cmf_chat_topic_related_objects')
    op.drop_index('ix_cmf_chat_topic_related_objects_root_id', table_name='cmf_chat_topic_related_objects')
    op.drop_table('cmf_chat_topic_related_objects')
    op.drop_index('ix_cmf_document_related_objects_left_id', table_name='cmf_document_related_objects')
    op.drop_index('ix_cmf_document_related_objects_parent_id', table_name='cmf_document_related_objects')
    op.drop_index('ix_cmf_document_related_objects_right_id', table_name='cmf_document_related_objects')
    op.drop_index('ix_cmf_document_related_objects_root_id', table_name='cmf_document_related_objects')
    op.drop_table('cmf_document_related_objects')
    op.drop_index('ix_cmf_pipeline_related_objects_left_id', table_name='cmf_pipeline_related_objects')
    op.drop_index('ix_cmf_pipeline_related_objects_parent_id', table_name='cmf_pipeline_related_objects')
    op.drop_index('ix_cmf_pipeline_related_objects_right_id', table_name='cmf_pipeline_related_objects')
    op.drop_index('ix_cmf_pipeline_related_objects_root_id', table_name='cmf_pipeline_related_objects')
    op.drop_table('cmf_pipeline_related_objects')
    op.drop_index('ix_cmf_sales_order_related_objects_left_id', table_name='cmf_sales_order_related_objects')
    op.drop_index('ix_cmf_sales_order_related_objects_parent_id', table_name='cmf_sales_order_related_objects')
    op.drop_index('ix_cmf_sales_order_related_objects_right_id', table_name='cmf_sales_order_related_objects')
    op.drop_index('ix_cmf_sales_order_related_objects_root_id', table_name='cmf_sales_order_related_objects')
    op.drop_table('cmf_sales_order_related_objects')
    op.drop_index('ix_cmf_invoice_related_objects_left_id', table_name='cmf_invoice_related_objects')
    op.drop_index('ix_cmf_invoice_related_objects_parent_id', table_name='cmf_invoice_related_objects')
    op.drop_index('ix_cmf_invoice_related_objects_right_id', table_name='cmf_invoice_related_objects')
    op.drop_index('ix_cmf_invoice_related_objects_root_id', table_name='cmf_invoice_related_objects')
    op.drop_table('cmf_invoice_related_objects')
    op.drop_index('ix_cmf_chat_group_related_objects_left_id', table_name='cmf_chat_group_related_objects')
    op.drop_index('ix_cmf_chat_group_related_objects_parent_id', table_name='cmf_chat_group_related_objects')
    op.drop_index('ix_cmf_chat_group_related_objects_right_id', table_name='cmf_chat_group_related_objects')
    op.drop_index('ix_cmf_chat_group_related_objects_root_id', table_name='cmf_chat_group_related_objects')
    op.drop_table('cmf_chat_group_related_objects')
    op.drop_index('ix_cmf_lead_related_objects_left_id', table_name='cmf_lead_related_objects')
    op.drop_index('ix_cmf_lead_related_objects_parent_id', table_name='cmf_lead_related_objects')
    op.drop_index('ix_cmf_lead_related_objects_right_id', table_name='cmf_lead_related_objects')
    op.drop_index('ix_cmf_lead_related_objects_root_id', table_name='cmf_lead_related_objects')
    op.drop_table('cmf_lead_related_objects')
    op.drop_index('ix_cmf_mail_related_objects_left_id', table_name='cmf_mail_related_objects')
    op.drop_index('ix_cmf_mail_related_objects_parent_id', table_name='cmf_mail_related_objects')
    op.drop_index('ix_cmf_mail_related_objects_right_id', table_name='cmf_mail_related_objects')
    op.drop_index('ix_cmf_mail_related_objects_root_id', table_name='cmf_mail_related_objects')
    op.drop_table('cmf_mail_related_objects')
    op.drop_index('ix_cmf_chat_group_parent_task_id', table_name='cmf_chat_group')
    op.drop_column('cmf_chat_group', 'parent_task_id')
    op.drop_index('ix_cmf_chat_topic_parent_task_id', table_name='cmf_chat_topic')
    op.drop_column('cmf_chat_topic', 'parent_task_id')
    op.drop_index('ix_cmf_company_parent_task_id', table_name='cmf_company')
    op.drop_column('cmf_company', 'parent_task_id')
    op.drop_index('ix_cmf_deal_parent_task_id', table_name='cmf_deal')
    op.drop_column('cmf_deal', 'parent_task_id')
    op.drop_index('ix_cmf_document_parent_task_id', table_name='cmf_document')
    op.drop_column('cmf_document', 'parent_task_id')
    op.drop_index('ix_cmf_invoice_parent_task_id', table_name='cmf_invoice')
    op.drop_column('cmf_invoice', 'parent_task_id')
    op.drop_index('ix_cmf_lead_parent_task_id', table_name='cmf_lead')
    op.drop_column('cmf_lead', 'parent_task_id')
    op.drop_index('ix_cmf_list_parent_task_id', table_name='cmf_list')
    op.drop_column('cmf_list', 'parent_task_id')
    op.drop_index('ix_cmf_mail_parent_task_id', table_name='cmf_mail')
    op.drop_column('cmf_mail', 'parent_task_id')
    op.drop_index('ix_cmf_payment_parent_task_id', table_name='cmf_payment')
    op.drop_column('cmf_payment', 'parent_task_id')
    op.drop_index('ix_cmf_pipeline_parent_task_id', table_name='cmf_pipeline')
    op.drop_column('cmf_pipeline', 'parent_task_id')
    op.drop_index('ix_cmf_purchase_order_parent_task_id', table_name='cmf_purchase_order')
    op.drop_column('cmf_purchase_order', 'parent_task_id')
    op.drop_index('ix_cmf_purchase_order_items_parent_task_id', table_name='cmf_purchase_order_items')
    op.drop_column('cmf_purchase_order_items', 'parent_task_id')
    op.drop_index('ix_cmf_sales_order_parent_task_id', table_name='cmf_sales_order')
    op.drop_column('cmf_sales_order', 'parent_task_id')
    op.drop_index('ix_cmf_stock_move_parent_task_id', table_name='cmf_stock_move')
    op.drop_column('cmf_stock_move', 'parent_task_id')
    op.drop_index('ix_cmf_stock_move_items_parent_task_id', table_name='cmf_stock_move_items')
    op.drop_column('cmf_stock_move_items', 'parent_task_id')
    op.drop_index('ix_cmf_task_parent_task_id', table_name='cmf_task')
    op.drop_column('cmf_task', 'parent_task_id')
    op.drop_index('ix_cmf_u_work_post_parent_task_id', table_name='cmf_u_work_post')
    op.drop_column('cmf_u_work_post', 'parent_task_id')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('cmf_u_work_post', sa.Column('parent_task_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True))
    op.create_index('ix_cmf_u_work_post_parent_task_id', 'cmf_u_work_post', ['parent_task_id'], unique=False)
    op.add_column('cmf_task', sa.Column('parent_task_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True))
    op.create_index('ix_cmf_task_parent_task_id', 'cmf_task', ['parent_task_id'], unique=False)
    op.add_column('cmf_stock_move_items', sa.Column('parent_task_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True))
    op.create_index('ix_cmf_stock_move_items_parent_task_id', 'cmf_stock_move_items', ['parent_task_id'], unique=False)
    op.add_column('cmf_stock_move', sa.Column('parent_task_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True))
    op.create_index('ix_cmf_stock_move_parent_task_id', 'cmf_stock_move', ['parent_task_id'], unique=False)
    op.add_column('cmf_sales_order', sa.Column('parent_task_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True))
    op.create_index('ix_cmf_sales_order_parent_task_id', 'cmf_sales_order', ['parent_task_id'], unique=False)
    op.add_column('cmf_purchase_order_items', sa.Column('parent_task_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True))
    op.create_index('ix_cmf_purchase_order_items_parent_task_id', 'cmf_purchase_order_items', ['parent_task_id'], unique=False)
    op.add_column('cmf_purchase_order', sa.Column('parent_task_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True))
    op.create_index('ix_cmf_purchase_order_parent_task_id', 'cmf_purchase_order', ['parent_task_id'], unique=False)
    op.add_column('cmf_pipeline', sa.Column('parent_task_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True))
    op.create_index('ix_cmf_pipeline_parent_task_id', 'cmf_pipeline', ['parent_task_id'], unique=False)
    op.add_column('cmf_payment', sa.Column('parent_task_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True))
    op.create_index('ix_cmf_payment_parent_task_id', 'cmf_payment', ['parent_task_id'], unique=False)
    op.add_column('cmf_mail', sa.Column('parent_task_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True))
    op.create_index('ix_cmf_mail_parent_task_id', 'cmf_mail', ['parent_task_id'], unique=False)
    op.add_column('cmf_list', sa.Column('parent_task_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True))
    op.create_index('ix_cmf_list_parent_task_id', 'cmf_list', ['parent_task_id'], unique=False)
    op.add_column('cmf_lead', sa.Column('parent_task_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True))
    op.create_index('ix_cmf_lead_parent_task_id', 'cmf_lead', ['parent_task_id'], unique=False)
    op.add_column('cmf_invoice', sa.Column('parent_task_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True))
    op.create_index('ix_cmf_invoice_parent_task_id', 'cmf_invoice', ['parent_task_id'], unique=False)
    op.add_column('cmf_document', sa.Column('parent_task_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True))
    op.create_index('ix_cmf_document_parent_task_id', 'cmf_document', ['parent_task_id'], unique=False)
    op.add_column('cmf_deal', sa.Column('parent_task_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True))
    op.create_index('ix_cmf_deal_parent_task_id', 'cmf_deal', ['parent_task_id'], unique=False)
    op.add_column('cmf_company', sa.Column('parent_task_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True))
    op.create_index('ix_cmf_company_parent_task_id', 'cmf_company', ['parent_task_id'], unique=False)
    op.add_column('cmf_chat_topic', sa.Column('parent_task_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True))
    op.create_index('ix_cmf_chat_topic_parent_task_id', 'cmf_chat_topic', ['parent_task_id'], unique=False)
    op.add_column('cmf_chat_group', sa.Column('parent_task_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True))
    op.create_index('ix_cmf_chat_group_parent_task_id', 'cmf_chat_group', ['parent_task_id'], unique=False)
    op.create_table('cmf_mail_related_objects',
    sa.Column('description', sa.VARCHAR(length=4096), autoincrement=False, nullable=True),
    sa.Column('id', sa.VARCHAR(length=64), autoincrement=False, nullable=False),
    sa.Column('left_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('left_name_cache', sa.VARCHAR(length=256), autoincrement=False, nullable=True),
    sa.Column('parent_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('right_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('right_name_cache', sa.VARCHAR(length=256), autoincrement=False, nullable=True),
    sa.Column('root_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.PrimaryKeyConstraint('id', name='cmf_mail_related_objects_pkey')
    )
    op.create_index('ix_cmf_mail_related_objects_root_id', 'cmf_mail_related_objects', ['root_id'], unique=False)
    op.create_index('ix_cmf_mail_related_objects_right_id', 'cmf_mail_related_objects', ['right_id'], unique=False)
    op.create_index('ix_cmf_mail_related_objects_parent_id', 'cmf_mail_related_objects', ['parent_id'], unique=False)
    op.create_index('ix_cmf_mail_related_objects_left_id', 'cmf_mail_related_objects', ['left_id'], unique=False)
    op.create_table('cmf_lead_related_objects',
    sa.Column('description', sa.VARCHAR(length=4096), autoincrement=False, nullable=True),
    sa.Column('id', sa.VARCHAR(length=64), autoincrement=False, nullable=False),
    sa.Column('left_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('left_name_cache', sa.VARCHAR(length=256), autoincrement=False, nullable=True),
    sa.Column('parent_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('right_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('right_name_cache', sa.VARCHAR(length=256), autoincrement=False, nullable=True),
    sa.Column('root_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.PrimaryKeyConstraint('id', name='cmf_lead_related_objects_pkey')
    )
    op.create_index('ix_cmf_lead_related_objects_root_id', 'cmf_lead_related_objects', ['root_id'], unique=False)
    op.create_index('ix_cmf_lead_related_objects_right_id', 'cmf_lead_related_objects', ['right_id'], unique=False)
    op.create_index('ix_cmf_lead_related_objects_parent_id', 'cmf_lead_related_objects', ['parent_id'], unique=False)
    op.create_index('ix_cmf_lead_related_objects_left_id', 'cmf_lead_related_objects', ['left_id'], unique=False)
    op.create_table('cmf_chat_group_related_objects',
    sa.Column('description', sa.VARCHAR(length=4096), autoincrement=False, nullable=True),
    sa.Column('id', sa.VARCHAR(length=64), autoincrement=False, nullable=False),
    sa.Column('left_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('left_name_cache', sa.VARCHAR(length=256), autoincrement=False, nullable=True),
    sa.Column('parent_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('right_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('right_name_cache', sa.VARCHAR(length=256), autoincrement=False, nullable=True),
    sa.Column('root_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.PrimaryKeyConstraint('id', name='cmf_u_work_chat_group_related_objects_pkey')
    )
    op.create_index('ix_cmf_chat_group_related_objects_root_id', 'cmf_chat_group_related_objects', ['root_id'], unique=False)
    op.create_index('ix_cmf_chat_group_related_objects_right_id', 'cmf_chat_group_related_objects', ['right_id'], unique=False)
    op.create_index('ix_cmf_chat_group_related_objects_parent_id', 'cmf_chat_group_related_objects', ['parent_id'], unique=False)
    op.create_index('ix_cmf_chat_group_related_objects_left_id', 'cmf_chat_group_related_objects', ['left_id'], unique=False)
    op.create_table('cmf_invoice_related_objects',
    sa.Column('description', sa.VARCHAR(length=4096), autoincrement=False, nullable=True),
    sa.Column('id', sa.VARCHAR(length=64), autoincrement=False, nullable=False),
    sa.Column('left_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('left_name_cache', sa.VARCHAR(length=256), autoincrement=False, nullable=True),
    sa.Column('parent_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('right_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('right_name_cache', sa.VARCHAR(length=256), autoincrement=False, nullable=True),
    sa.Column('root_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.PrimaryKeyConstraint('id', name='cmf_invoice_related_objects_pkey')
    )
    op.create_index('ix_cmf_invoice_related_objects_root_id', 'cmf_invoice_related_objects', ['root_id'], unique=False)
    op.create_index('ix_cmf_invoice_related_objects_right_id', 'cmf_invoice_related_objects', ['right_id'], unique=False)
    op.create_index('ix_cmf_invoice_related_objects_parent_id', 'cmf_invoice_related_objects', ['parent_id'], unique=False)
    op.create_index('ix_cmf_invoice_related_objects_left_id', 'cmf_invoice_related_objects', ['left_id'], unique=False)
    op.create_table('cmf_sales_order_related_objects',
    sa.Column('description', sa.VARCHAR(length=4096), autoincrement=False, nullable=True),
    sa.Column('id', sa.VARCHAR(length=64), autoincrement=False, nullable=False),
    sa.Column('left_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('left_name_cache', sa.VARCHAR(length=256), autoincrement=False, nullable=True),
    sa.Column('parent_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('right_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('right_name_cache', sa.VARCHAR(length=256), autoincrement=False, nullable=True),
    sa.Column('root_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.PrimaryKeyConstraint('id', name='cmf_sales_order_related_objects_pkey')
    )
    op.create_index('ix_cmf_sales_order_related_objects_root_id', 'cmf_sales_order_related_objects', ['root_id'], unique=False)
    op.create_index('ix_cmf_sales_order_related_objects_right_id', 'cmf_sales_order_related_objects', ['right_id'], unique=False)
    op.create_index('ix_cmf_sales_order_related_objects_parent_id', 'cmf_sales_order_related_objects', ['parent_id'], unique=False)
    op.create_index('ix_cmf_sales_order_related_objects_left_id', 'cmf_sales_order_related_objects', ['left_id'], unique=False)
    op.create_table('cmf_pipeline_related_objects',
    sa.Column('description', sa.VARCHAR(length=4096), autoincrement=False, nullable=True),
    sa.Column('id', sa.VARCHAR(length=64), autoincrement=False, nullable=False),
    sa.Column('left_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('left_name_cache', sa.VARCHAR(length=256), autoincrement=False, nullable=True),
    sa.Column('parent_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('right_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('right_name_cache', sa.VARCHAR(length=256), autoincrement=False, nullable=True),
    sa.Column('root_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.PrimaryKeyConstraint('id', name='cmf_pipeline_related_objects_pkey')
    )
    op.create_index('ix_cmf_pipeline_related_objects_root_id', 'cmf_pipeline_related_objects', ['root_id'], unique=False)
    op.create_index('ix_cmf_pipeline_related_objects_right_id', 'cmf_pipeline_related_objects', ['right_id'], unique=False)
    op.create_index('ix_cmf_pipeline_related_objects_parent_id', 'cmf_pipeline_related_objects', ['parent_id'], unique=False)
    op.create_index('ix_cmf_pipeline_related_objects_left_id', 'cmf_pipeline_related_objects', ['left_id'], unique=False)
    op.create_table('cmf_document_related_objects',
    sa.Column('description', sa.VARCHAR(length=4096), autoincrement=False, nullable=True),
    sa.Column('id', sa.VARCHAR(length=64), autoincrement=False, nullable=False),
    sa.Column('left_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('left_name_cache', sa.VARCHAR(length=256), autoincrement=False, nullable=True),
    sa.Column('parent_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('right_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('right_name_cache', sa.VARCHAR(length=256), autoincrement=False, nullable=True),
    sa.Column('root_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.PrimaryKeyConstraint('id', name='cmf_document_related_objects_pkey')
    )
    op.create_index('ix_cmf_document_related_objects_root_id', 'cmf_document_related_objects', ['root_id'], unique=False)
    op.create_index('ix_cmf_document_related_objects_right_id', 'cmf_document_related_objects', ['right_id'], unique=False)
    op.create_index('ix_cmf_document_related_objects_parent_id', 'cmf_document_related_objects', ['parent_id'], unique=False)
    op.create_index('ix_cmf_document_related_objects_left_id', 'cmf_document_related_objects', ['left_id'], unique=False)
    op.create_table('cmf_chat_topic_related_objects',
    sa.Column('description', sa.VARCHAR(length=4096), autoincrement=False, nullable=True),
    sa.Column('id', sa.VARCHAR(length=64), autoincrement=False, nullable=False),
    sa.Column('left_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('left_name_cache', sa.VARCHAR(length=256), autoincrement=False, nullable=True),
    sa.Column('parent_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('right_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('right_name_cache', sa.VARCHAR(length=256), autoincrement=False, nullable=True),
    sa.Column('root_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.PrimaryKeyConstraint('id', name='cmf_u_work_chat_topic_related_objects_pkey')
    )
    op.create_index('ix_cmf_chat_topic_related_objects_root_id', 'cmf_chat_topic_related_objects', ['root_id'], unique=False)
    op.create_index('ix_cmf_chat_topic_related_objects_right_id', 'cmf_chat_topic_related_objects', ['right_id'], unique=False)
    op.create_index('ix_cmf_chat_topic_related_objects_parent_id', 'cmf_chat_topic_related_objects', ['parent_id'], unique=False)
    op.create_index('ix_cmf_chat_topic_related_objects_left_id', 'cmf_chat_topic_related_objects', ['left_id'], unique=False)
    op.create_table('cmf_payment_related_objects',
    sa.Column('description', sa.VARCHAR(length=4096), autoincrement=False, nullable=True),
    sa.Column('id', sa.VARCHAR(length=64), autoincrement=False, nullable=False),
    sa.Column('left_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('left_name_cache', sa.VARCHAR(length=256), autoincrement=False, nullable=True),
    sa.Column('parent_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('right_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('right_name_cache', sa.VARCHAR(length=256), autoincrement=False, nullable=True),
    sa.Column('root_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.PrimaryKeyConstraint('id', name='cmf_payment_related_objects_pkey')
    )
    op.create_index('ix_cmf_payment_related_objects_root_id', 'cmf_payment_related_objects', ['root_id'], unique=False)
    op.create_index('ix_cmf_payment_related_objects_right_id', 'cmf_payment_related_objects', ['right_id'], unique=False)
    op.create_index('ix_cmf_payment_related_objects_parent_id', 'cmf_payment_related_objects', ['parent_id'], unique=False)
    op.create_index('ix_cmf_payment_related_objects_left_id', 'cmf_payment_related_objects', ['left_id'], unique=False)
    op.create_table('cmf_stock_move_related_objects',
    sa.Column('description', sa.VARCHAR(length=4096), autoincrement=False, nullable=True),
    sa.Column('id', sa.VARCHAR(length=64), autoincrement=False, nullable=False),
    sa.Column('left_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('left_name_cache', sa.VARCHAR(length=256), autoincrement=False, nullable=True),
    sa.Column('parent_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('right_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('right_name_cache', sa.VARCHAR(length=256), autoincrement=False, nullable=True),
    sa.Column('root_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.PrimaryKeyConstraint('id', name='cmf_stock_move_related_objects_pkey')
    )
    op.create_index('ix_cmf_stock_move_related_objects_root_id', 'cmf_stock_move_related_objects', ['root_id'], unique=False)
    op.create_index('ix_cmf_stock_move_related_objects_right_id', 'cmf_stock_move_related_objects', ['right_id'], unique=False)
    op.create_index('ix_cmf_stock_move_related_objects_parent_id', 'cmf_stock_move_related_objects', ['parent_id'], unique=False)
    op.create_index('ix_cmf_stock_move_related_objects_left_id', 'cmf_stock_move_related_objects', ['left_id'], unique=False)
    op.create_table('cmf_stock_move_items_related_objects',
    sa.Column('description', sa.VARCHAR(length=4096), autoincrement=False, nullable=True),
    sa.Column('id', sa.VARCHAR(length=64), autoincrement=False, nullable=False),
    sa.Column('left_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('left_name_cache', sa.VARCHAR(length=256), autoincrement=False, nullable=True),
    sa.Column('parent_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('right_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('right_name_cache', sa.VARCHAR(length=256), autoincrement=False, nullable=True),
    sa.Column('root_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.PrimaryKeyConstraint('id', name='cmf_stock_move_items_related_objects_pkey')
    )
    op.create_index('ix_cmf_stock_move_items_related_objects_root_id', 'cmf_stock_move_items_related_objects', ['root_id'], unique=False)
    op.create_index('ix_cmf_stock_move_items_related_objects_right_id', 'cmf_stock_move_items_related_objects', ['right_id'], unique=False)
    op.create_index('ix_cmf_stock_move_items_related_objects_parent_id', 'cmf_stock_move_items_related_objects', ['parent_id'], unique=False)
    op.create_index('ix_cmf_stock_move_items_related_objects_left_id', 'cmf_stock_move_items_related_objects', ['left_id'], unique=False)
    op.create_table('cmf_deal_related_objects',
    sa.Column('description', sa.VARCHAR(length=4096), autoincrement=False, nullable=True),
    sa.Column('id', sa.VARCHAR(length=64), autoincrement=False, nullable=False),
    sa.Column('left_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('left_name_cache', sa.VARCHAR(length=256), autoincrement=False, nullable=True),
    sa.Column('parent_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('right_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('right_name_cache', sa.VARCHAR(length=256), autoincrement=False, nullable=True),
    sa.Column('root_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.PrimaryKeyConstraint('id', name='cmf_deal_related_objects_pkey')
    )
    op.create_index('ix_cmf_deal_related_objects_root_id', 'cmf_deal_related_objects', ['root_id'], unique=False)
    op.create_index('ix_cmf_deal_related_objects_right_id', 'cmf_deal_related_objects', ['right_id'], unique=False)
    op.create_index('ix_cmf_deal_related_objects_parent_id', 'cmf_deal_related_objects', ['parent_id'], unique=False)
    op.create_index('ix_cmf_deal_related_objects_left_id', 'cmf_deal_related_objects', ['left_id'], unique=False)
    op.create_table('cmf_list_related_objects',
    sa.Column('description', sa.VARCHAR(length=4096), autoincrement=False, nullable=True),
    sa.Column('id', sa.VARCHAR(length=64), autoincrement=False, nullable=False),
    sa.Column('left_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('left_name_cache', sa.VARCHAR(length=256), autoincrement=False, nullable=True),
    sa.Column('parent_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('right_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('right_name_cache', sa.VARCHAR(length=256), autoincrement=False, nullable=True),
    sa.Column('root_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.PrimaryKeyConstraint('id', name='cmf_u_work_list_related_objects_pkey')
    )
    op.create_index('ix_cmf_list_related_objects_root_id', 'cmf_list_related_objects', ['root_id'], unique=False)
    op.create_index('ix_cmf_list_related_objects_right_id', 'cmf_list_related_objects', ['right_id'], unique=False)
    op.create_index('ix_cmf_list_related_objects_parent_id', 'cmf_list_related_objects', ['parent_id'], unique=False)
    op.create_index('ix_cmf_list_related_objects_left_id', 'cmf_list_related_objects', ['left_id'], unique=False)
    op.create_table('cmf_purchase_order_related_objects',
    sa.Column('description', sa.VARCHAR(length=4096), autoincrement=False, nullable=True),
    sa.Column('id', sa.VARCHAR(length=64), autoincrement=False, nullable=False),
    sa.Column('left_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('left_name_cache', sa.VARCHAR(length=256), autoincrement=False, nullable=True),
    sa.Column('parent_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('right_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('right_name_cache', sa.VARCHAR(length=256), autoincrement=False, nullable=True),
    sa.Column('root_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.PrimaryKeyConstraint('id', name='cmf_purchase_order_related_objects_pkey')
    )
    op.create_index('ix_cmf_purchase_order_related_objects_root_id', 'cmf_purchase_order_related_objects', ['root_id'], unique=False)
    op.create_index('ix_cmf_purchase_order_related_objects_right_id', 'cmf_purchase_order_related_objects', ['right_id'], unique=False)
    op.create_index('ix_cmf_purchase_order_related_objects_parent_id', 'cmf_purchase_order_related_objects', ['parent_id'], unique=False)
    op.create_index('ix_cmf_purchase_order_related_objects_left_id', 'cmf_purchase_order_related_objects', ['left_id'], unique=False)
    op.create_table('cmf_company_related_objects',
    sa.Column('description', sa.VARCHAR(length=4096), autoincrement=False, nullable=True),
    sa.Column('id', sa.VARCHAR(length=64), autoincrement=False, nullable=False),
    sa.Column('left_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('left_name_cache', sa.VARCHAR(length=256), autoincrement=False, nullable=True),
    sa.Column('parent_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('right_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('right_name_cache', sa.VARCHAR(length=256), autoincrement=False, nullable=True),
    sa.Column('root_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.PrimaryKeyConstraint('id', name='cmf_company_related_objects_pkey')
    )
    op.create_index('ix_cmf_company_related_objects_root_id', 'cmf_company_related_objects', ['root_id'], unique=False)
    op.create_index('ix_cmf_company_related_objects_right_id', 'cmf_company_related_objects', ['right_id'], unique=False)
    op.create_index('ix_cmf_company_related_objects_parent_id', 'cmf_company_related_objects', ['parent_id'], unique=False)
    op.create_index('ix_cmf_company_related_objects_left_id', 'cmf_company_related_objects', ['left_id'], unique=False)
    op.create_table('cmf_purchase_order_items_related_objects',
    sa.Column('description', sa.VARCHAR(length=4096), autoincrement=False, nullable=True),
    sa.Column('id', sa.VARCHAR(length=64), autoincrement=False, nullable=False),
    sa.Column('left_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('left_name_cache', sa.VARCHAR(length=256), autoincrement=False, nullable=True),
    sa.Column('parent_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('right_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('right_name_cache', sa.VARCHAR(length=256), autoincrement=False, nullable=True),
    sa.Column('root_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.PrimaryKeyConstraint('id', name='cmf_purchase_order_items_related_objects_pkey')
    )
    op.create_index('ix_cmf_purchase_order_items_related_objects_root_id', 'cmf_purchase_order_items_related_objects', ['root_id'], unique=False)
    op.create_index('ix_cmf_purchase_order_items_related_objects_right_id', 'cmf_purchase_order_items_related_objects', ['right_id'], unique=False)
    op.create_index('ix_cmf_purchase_order_items_related_objects_parent_id', 'cmf_purchase_order_items_related_objects', ['parent_id'], unique=False)
    op.create_index('ix_cmf_purchase_order_items_related_objects_left_id', 'cmf_purchase_order_items_related_objects', ['left_id'], unique=False)
    op.create_table('cmf_u_work_post_related_objects',
    sa.Column('description', sa.VARCHAR(length=4096), autoincrement=False, nullable=True),
    sa.Column('id', sa.VARCHAR(length=64), autoincrement=False, nullable=False),
    sa.Column('left_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('left_name_cache', sa.VARCHAR(length=256), autoincrement=False, nullable=True),
    sa.Column('parent_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('right_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('right_name_cache', sa.VARCHAR(length=256), autoincrement=False, nullable=True),
    sa.Column('root_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.PrimaryKeyConstraint('id', name='cmf_u_work_post_related_objects_pkey')
    )
    op.create_index('ix_cmf_u_work_post_related_objects_root_id', 'cmf_u_work_post_related_objects', ['root_id'], unique=False)
    op.create_index('ix_cmf_u_work_post_related_objects_right_id', 'cmf_u_work_post_related_objects', ['right_id'], unique=False)
    op.create_index('ix_cmf_u_work_post_related_objects_parent_id', 'cmf_u_work_post_related_objects', ['parent_id'], unique=False)
    op.create_index('ix_cmf_u_work_post_related_objects_left_id', 'cmf_u_work_post_related_objects', ['left_id'], unique=False)
    op.create_table('cmf_task_related_objects',
    sa.Column('description', sa.VARCHAR(length=4096), autoincrement=False, nullable=True),
    sa.Column('id', sa.VARCHAR(length=64), autoincrement=False, nullable=False),
    sa.Column('left_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('left_name_cache', sa.VARCHAR(length=256), autoincrement=False, nullable=True),
    sa.Column('parent_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('right_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('right_name_cache', sa.VARCHAR(length=256), autoincrement=False, nullable=True),
    sa.Column('root_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.PrimaryKeyConstraint('id', name='cmf_u_work_task_related_objects_pkey')
    )
    op.create_index('ix_cmf_task_related_objects_root_id', 'cmf_task_related_objects', ['root_id'], unique=False)
    op.create_index('ix_cmf_task_related_objects_right_id', 'cmf_task_related_objects', ['right_id'], unique=False)
    op.create_index('ix_cmf_task_related_objects_parent_id', 'cmf_task_related_objects', ['parent_id'], unique=False)
    op.create_index('ix_cmf_task_related_objects_left_id', 'cmf_task_related_objects', ['left_id'], unique=False)
    op.drop_index(op.f('ix_cmf_u_work_post_parent_objects_root_id'), table_name='cmf_u_work_post_parent_objects')
    op.drop_index(op.f('ix_cmf_u_work_post_parent_objects_right_id'), table_name='cmf_u_work_post_parent_objects')
    op.drop_index(op.f('ix_cmf_u_work_post_parent_objects_parent_id'), table_name='cmf_u_work_post_parent_objects')
    op.drop_index(op.f('ix_cmf_u_work_post_parent_objects_left_id'), table_name='cmf_u_work_post_parent_objects')
    op.drop_table('cmf_u_work_post_parent_objects')
    op.drop_index(op.f('ix_cmf_task_parent_objects_root_id'), table_name='cmf_task_parent_objects')
    op.drop_index(op.f('ix_cmf_task_parent_objects_right_id'), table_name='cmf_task_parent_objects')
    op.drop_index(op.f('ix_cmf_task_parent_objects_parent_id'), table_name='cmf_task_parent_objects')
    op.drop_index(op.f('ix_cmf_task_parent_objects_left_id'), table_name='cmf_task_parent_objects')
    op.drop_table('cmf_task_parent_objects')
    op.drop_index(op.f('ix_cmf_stock_move_parent_objects_root_id'), table_name='cmf_stock_move_parent_objects')
    op.drop_index(op.f('ix_cmf_stock_move_parent_objects_right_id'), table_name='cmf_stock_move_parent_objects')
    op.drop_index(op.f('ix_cmf_stock_move_parent_objects_parent_id'), table_name='cmf_stock_move_parent_objects')
    op.drop_index(op.f('ix_cmf_stock_move_parent_objects_left_id'), table_name='cmf_stock_move_parent_objects')
    op.drop_table('cmf_stock_move_parent_objects')
    op.drop_index(op.f('ix_cmf_stock_move_items_parent_objects_root_id'), table_name='cmf_stock_move_items_parent_objects')
    op.drop_index(op.f('ix_cmf_stock_move_items_parent_objects_right_id'), table_name='cmf_stock_move_items_parent_objects')
    op.drop_index(op.f('ix_cmf_stock_move_items_parent_objects_parent_id'), table_name='cmf_stock_move_items_parent_objects')
    op.drop_index(op.f('ix_cmf_stock_move_items_parent_objects_left_id'), table_name='cmf_stock_move_items_parent_objects')
    op.drop_table('cmf_stock_move_items_parent_objects')
    op.drop_index(op.f('ix_cmf_sales_order_parent_objects_root_id'), table_name='cmf_sales_order_parent_objects')
    op.drop_index(op.f('ix_cmf_sales_order_parent_objects_right_id'), table_name='cmf_sales_order_parent_objects')
    op.drop_index(op.f('ix_cmf_sales_order_parent_objects_parent_id'), table_name='cmf_sales_order_parent_objects')
    op.drop_index(op.f('ix_cmf_sales_order_parent_objects_left_id'), table_name='cmf_sales_order_parent_objects')
    op.drop_table('cmf_sales_order_parent_objects')
    op.drop_index(op.f('ix_cmf_purchase_order_parent_objects_root_id'), table_name='cmf_purchase_order_parent_objects')
    op.drop_index(op.f('ix_cmf_purchase_order_parent_objects_right_id'), table_name='cmf_purchase_order_parent_objects')
    op.drop_index(op.f('ix_cmf_purchase_order_parent_objects_parent_id'), table_name='cmf_purchase_order_parent_objects')
    op.drop_index(op.f('ix_cmf_purchase_order_parent_objects_left_id'), table_name='cmf_purchase_order_parent_objects')
    op.drop_table('cmf_purchase_order_parent_objects')
    op.drop_index(op.f('ix_cmf_purchase_order_items_parent_objects_root_id'), table_name='cmf_purchase_order_items_parent_objects')
    op.drop_index(op.f('ix_cmf_purchase_order_items_parent_objects_right_id'), table_name='cmf_purchase_order_items_parent_objects')
    op.drop_index(op.f('ix_cmf_purchase_order_items_parent_objects_parent_id'), table_name='cmf_purchase_order_items_parent_objects')
    op.drop_index(op.f('ix_cmf_purchase_order_items_parent_objects_left_id'), table_name='cmf_purchase_order_items_parent_objects')
    op.drop_table('cmf_purchase_order_items_parent_objects')
    op.drop_index(op.f('ix_cmf_pipeline_parent_objects_root_id'), table_name='cmf_pipeline_parent_objects')
    op.drop_index(op.f('ix_cmf_pipeline_parent_objects_right_id'), table_name='cmf_pipeline_parent_objects')
    op.drop_index(op.f('ix_cmf_pipeline_parent_objects_parent_id'), table_name='cmf_pipeline_parent_objects')
    op.drop_index(op.f('ix_cmf_pipeline_parent_objects_left_id'), table_name='cmf_pipeline_parent_objects')
    op.drop_table('cmf_pipeline_parent_objects')
    op.drop_index(op.f('ix_cmf_payment_parent_objects_root_id'), table_name='cmf_payment_parent_objects')
    op.drop_index(op.f('ix_cmf_payment_parent_objects_right_id'), table_name='cmf_payment_parent_objects')
    op.drop_index(op.f('ix_cmf_payment_parent_objects_parent_id'), table_name='cmf_payment_parent_objects')
    op.drop_index(op.f('ix_cmf_payment_parent_objects_left_id'), table_name='cmf_payment_parent_objects')
    op.drop_table('cmf_payment_parent_objects')
    op.drop_index(op.f('ix_cmf_mail_parent_objects_root_id'), table_name='cmf_mail_parent_objects')
    op.drop_index(op.f('ix_cmf_mail_parent_objects_right_id'), table_name='cmf_mail_parent_objects')
    op.drop_index(op.f('ix_cmf_mail_parent_objects_parent_id'), table_name='cmf_mail_parent_objects')
    op.drop_index(op.f('ix_cmf_mail_parent_objects_left_id'), table_name='cmf_mail_parent_objects')
    op.drop_table('cmf_mail_parent_objects')
    op.drop_index(op.f('ix_cmf_list_parent_objects_root_id'), table_name='cmf_list_parent_objects')
    op.drop_index(op.f('ix_cmf_list_parent_objects_right_id'), table_name='cmf_list_parent_objects')
    op.drop_index(op.f('ix_cmf_list_parent_objects_parent_id'), table_name='cmf_list_parent_objects')
    op.drop_index(op.f('ix_cmf_list_parent_objects_left_id'), table_name='cmf_list_parent_objects')
    op.drop_table('cmf_list_parent_objects')
    op.drop_index(op.f('ix_cmf_lead_parent_objects_root_id'), table_name='cmf_lead_parent_objects')
    op.drop_index(op.f('ix_cmf_lead_parent_objects_right_id'), table_name='cmf_lead_parent_objects')
    op.drop_index(op.f('ix_cmf_lead_parent_objects_parent_id'), table_name='cmf_lead_parent_objects')
    op.drop_index(op.f('ix_cmf_lead_parent_objects_left_id'), table_name='cmf_lead_parent_objects')
    op.drop_table('cmf_lead_parent_objects')
    op.drop_index(op.f('ix_cmf_invoice_parent_objects_root_id'), table_name='cmf_invoice_parent_objects')
    op.drop_index(op.f('ix_cmf_invoice_parent_objects_right_id'), table_name='cmf_invoice_parent_objects')
    op.drop_index(op.f('ix_cmf_invoice_parent_objects_parent_id'), table_name='cmf_invoice_parent_objects')
    op.drop_index(op.f('ix_cmf_invoice_parent_objects_left_id'), table_name='cmf_invoice_parent_objects')
    op.drop_table('cmf_invoice_parent_objects')
    op.drop_index(op.f('ix_cmf_document_parent_objects_root_id'), table_name='cmf_document_parent_objects')
    op.drop_index(op.f('ix_cmf_document_parent_objects_right_id'), table_name='cmf_document_parent_objects')
    op.drop_index(op.f('ix_cmf_document_parent_objects_parent_id'), table_name='cmf_document_parent_objects')
    op.drop_index(op.f('ix_cmf_document_parent_objects_left_id'), table_name='cmf_document_parent_objects')
    op.drop_table('cmf_document_parent_objects')
    op.drop_index(op.f('ix_cmf_deal_parent_objects_root_id'), table_name='cmf_deal_parent_objects')
    op.drop_index(op.f('ix_cmf_deal_parent_objects_right_id'), table_name='cmf_deal_parent_objects')
    op.drop_index(op.f('ix_cmf_deal_parent_objects_parent_id'), table_name='cmf_deal_parent_objects')
    op.drop_index(op.f('ix_cmf_deal_parent_objects_left_id'), table_name='cmf_deal_parent_objects')
    op.drop_table('cmf_deal_parent_objects')
    op.drop_index(op.f('ix_cmf_company_parent_objects_root_id'), table_name='cmf_company_parent_objects')
    op.drop_index(op.f('ix_cmf_company_parent_objects_right_id'), table_name='cmf_company_parent_objects')
    op.drop_index(op.f('ix_cmf_company_parent_objects_parent_id'), table_name='cmf_company_parent_objects')
    op.drop_index(op.f('ix_cmf_company_parent_objects_left_id'), table_name='cmf_company_parent_objects')
    op.drop_table('cmf_company_parent_objects')
    op.drop_index(op.f('ix_cmf_chat_topic_parent_objects_root_id'), table_name='cmf_chat_topic_parent_objects')
    op.drop_index(op.f('ix_cmf_chat_topic_parent_objects_right_id'), table_name='cmf_chat_topic_parent_objects')
    op.drop_index(op.f('ix_cmf_chat_topic_parent_objects_parent_id'), table_name='cmf_chat_topic_parent_objects')
    op.drop_index(op.f('ix_cmf_chat_topic_parent_objects_left_id'), table_name='cmf_chat_topic_parent_objects')
    op.drop_table('cmf_chat_topic_parent_objects')
    op.drop_index(op.f('ix_cmf_chat_group_parent_objects_root_id'), table_name='cmf_chat_group_parent_objects')
    op.drop_index(op.f('ix_cmf_chat_group_parent_objects_right_id'), table_name='cmf_chat_group_parent_objects')
    op.drop_index(op.f('ix_cmf_chat_group_parent_objects_parent_id'), table_name='cmf_chat_group_parent_objects')
    op.drop_index(op.f('ix_cmf_chat_group_parent_objects_left_id'), table_name='cmf_chat_group_parent_objects')
    op.drop_table('cmf_chat_group_parent_objects')
    # ### end Alembic commands ###
