"""empty message

Revision ID: 6027b3a5875e
Revises: 2914f0e09877
Create Date: 2022-05-22 22:07:11.463968

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '6027b3a5875e'
down_revision = '2914f0e09877'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('cmf_activity', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_activity', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_activity', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_activity', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_activity_tree_parent_id'), 'cmf_activity', ['tree_parent_id'], unique=False)
    op.add_column('cmf_attachment', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_attachment', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_attachment', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_attachment', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_attachment_tree_parent_id'), 'cmf_attachment', ['tree_parent_id'], unique=False)
    op.add_column('cmf_balance', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_balance', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_balance', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_balance', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_balance_tree_parent_id'), 'cmf_balance', ['tree_parent_id'], unique=False)
    op.add_column('cmf_balance_operation', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_balance_operation', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_balance_operation', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_balance_operation', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_balance_operation_tree_parent_id'), 'cmf_balance_operation', ['tree_parent_id'], unique=False)
    op.add_column('cmf_card', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_card', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_card', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_card', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_card_tree_parent_id'), 'cmf_card', ['tree_parent_id'], unique=False)
    op.add_column('cmf_chat_message', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_chat_message', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_chat_message', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_chat_message', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_chat_message_tree_parent_id'), 'cmf_chat_message', ['tree_parent_id'], unique=False)
    op.add_column('cmf_comment', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_comment', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_comment', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_contract', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_contract', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_contract', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_contract', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_contract_tree_parent_id'), 'cmf_contract', ['tree_parent_id'], unique=False)
    op.add_column('cmf_currency', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_currency', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_currency', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_currency', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_currency_tree_parent_id'), 'cmf_currency', ['tree_parent_id'], unique=False)
    op.add_column('cmf_deal_items', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_deal_items', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_deal_items', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_deal_items', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_deal_items_tree_parent_id'), 'cmf_deal_items', ['tree_parent_id'], unique=False)
    op.add_column('cmf_document_history', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_document_history', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_document_history', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_document_history', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_document_history_tree_parent_id'), 'cmf_document_history', ['tree_parent_id'], unique=False)
    op.add_column('cmf_filter', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_filter', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_filter', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_filter', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_filter_tree_parent_id'), 'cmf_filter', ['tree_parent_id'], unique=False)
    op.add_column('cmf_form', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_form', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_form', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_form', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_form_tree_parent_id'), 'cmf_form', ['tree_parent_id'], unique=False)
    op.add_column('cmf_form_field', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_form_field', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_form_field', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_form_field', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_form_field_tree_parent_id'), 'cmf_form_field', ['tree_parent_id'], unique=False)
    op.add_column('cmf_import', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_import', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_import', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_import', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_import_tree_parent_id'), 'cmf_import', ['tree_parent_id'], unique=False)
    op.add_column('cmf_integration', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_integration', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_integration', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_integration', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_integration_tree_parent_id'), 'cmf_integration', ['tree_parent_id'], unique=False)
    op.add_column('cmf_invoice_items', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_invoice_items', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_invoice_items', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_invoice_items', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_invoice_items_tree_parent_id'), 'cmf_invoice_items', ['tree_parent_id'], unique=False)
    op.add_column('cmf_job', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_job', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_job', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_job', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_job_tree_parent_id'), 'cmf_job', ['tree_parent_id'], unique=False)
    op.add_column('cmf_lead_mailbox', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_lead_mailbox', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_lead_mailbox', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_lead_mailbox', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_lead_mailbox_tree_parent_id'), 'cmf_lead_mailbox', ['tree_parent_id'], unique=False)
    op.add_column('cmf_link', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_link', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_link', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_link', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_link_tree_parent_id'), 'cmf_link', ['tree_parent_id'], unique=False)
    op.add_column('cmf_mail_signature', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_mail_signature', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_mail_signature', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_mail_signature', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_mail_signature_tree_parent_id'), 'cmf_mail_signature', ['tree_parent_id'], unique=False)
    op.add_column('cmf_mail_template', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_mail_template', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_mail_template', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_mail_template', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_mail_template_tree_parent_id'), 'cmf_mail_template', ['tree_parent_id'], unique=False)
    op.add_column('cmf_mailbox', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_mailbox', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_mailbox', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_mailbox', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_mailbox_tree_parent_id'), 'cmf_mailbox', ['tree_parent_id'], unique=False)
    op.add_column('cmf_menu_item', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_menu_item', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_menu_item', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_menu_item', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_menu_item_tree_parent_id'), 'cmf_menu_item', ['tree_parent_id'], unique=False)
    op.add_column('cmf_menu_tree', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_menu_tree', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_menu_tree', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_menu_tree', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_menu_tree_tree_parent_id'), 'cmf_menu_tree', ['tree_parent_id'], unique=False)
    op.add_column('cmf_notify', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_notify', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_notify', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_notify', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_notify_tree_parent_id'), 'cmf_notify', ['tree_parent_id'], unique=False)
    op.add_column('cmf_org_unit', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_org_unit', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_org_unit', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_person', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_person', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_person', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_person', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_person_tree_parent_id'), 'cmf_person', ['tree_parent_id'], unique=False)
    op.add_column('cmf_person_group', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_person_group', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_person_group', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_person_group', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_person_group_tree_parent_id'), 'cmf_person_group', ['tree_parent_id'], unique=False)
    op.add_column('cmf_person_var', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_person_var', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_person_var', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_person_var', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_person_var_tree_parent_id'), 'cmf_person_var', ['tree_parent_id'], unique=False)
    op.add_column('cmf_plan', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_plan', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_plan', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_plan', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_plan_tree_parent_id'), 'cmf_plan', ['tree_parent_id'], unique=False)
    op.add_column('cmf_plugin', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_plugin', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_plugin', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_plugin', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_plugin_tree_parent_id'), 'cmf_plugin', ['tree_parent_id'], unique=False)
    op.add_column('cmf_plugin_asana', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_plugin_asana', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_plugin_asana', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_plugin_asana', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_plugin_asana_tree_parent_id'), 'cmf_plugin_asana', ['tree_parent_id'], unique=False)
    op.add_column('cmf_plugin_confluence', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_plugin_confluence', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_plugin_confluence', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_plugin_confluence', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_plugin_confluence_tree_parent_id'), 'cmf_plugin_confluence', ['tree_parent_id'], unique=False)
    op.add_column('cmf_plugin_jira', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_plugin_jira', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_plugin_jira', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_plugin_jira', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_plugin_jira_tree_parent_id'), 'cmf_plugin_jira', ['tree_parent_id'], unique=False)
    op.add_column('cmf_plugin_mail_box', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_plugin_mail_box', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_plugin_mail_box', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_plugin_mail_box', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_plugin_mail_box_tree_parent_id'), 'cmf_plugin_mail_box', ['tree_parent_id'], unique=False)
    op.add_column('cmf_plugin_s_m_s_gate', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_plugin_s_m_s_gate', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_plugin_s_m_s_gate', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_plugin_s_m_s_gate', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_plugin_s_m_s_gate_tree_parent_id'), 'cmf_plugin_s_m_s_gate', ['tree_parent_id'], unique=False)
    op.add_column('cmf_plugin_telphin', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_plugin_telphin', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_plugin_telphin', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_plugin_telphin', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_plugin_telphin_tree_parent_id'), 'cmf_plugin_telphin', ['tree_parent_id'], unique=False)
    op.add_column('cmf_plugin_trello', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_plugin_trello', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_plugin_trello', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_plugin_trello', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_plugin_trello_tree_parent_id'), 'cmf_plugin_trello', ['tree_parent_id'], unique=False)
    op.add_column('cmf_plugin_zadarma', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_plugin_zadarma', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_plugin_zadarma', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_plugin_zadarma', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_plugin_zadarma_tree_parent_id'), 'cmf_plugin_zadarma', ['tree_parent_id'], unique=False)
    op.add_column('cmf_price', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_price', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_price', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_price', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_price_tree_parent_id'), 'cmf_price', ['tree_parent_id'], unique=False)
    op.add_column('cmf_print_tmpl', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_print_tmpl', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_print_tmpl', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_print_tmpl', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_print_tmpl_tree_parent_id'), 'cmf_print_tmpl', ['tree_parent_id'], unique=False)
    op.add_column('cmf_product', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_product', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_product', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_product', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_product_tree_parent_id'), 'cmf_product', ['tree_parent_id'], unique=False)
    op.add_column('cmf_role', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_role', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_role', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_staff_control_settings', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_staff_control_settings', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_staff_control_settings', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_staff_control_settings', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_staff_control_settings_tree_parent_id'), 'cmf_staff_control_settings', ['tree_parent_id'], unique=False)
    op.add_column('cmf_status', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_status', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_status', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_status', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_status_tree_parent_id'), 'cmf_status', ['tree_parent_id'], unique=False)
    op.add_column('cmf_status_opt', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_status_opt', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_status_opt', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_status_opt', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_status_opt_tree_parent_id'), 'cmf_status_opt', ['tree_parent_id'], unique=False)
    op.add_column('cmf_stock', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_stock', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_stock', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_stock', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_stock_tree_parent_id'), 'cmf_stock', ['tree_parent_id'], unique=False)
    op.add_column('cmf_stock_items', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_stock_items', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_stock_items', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_stock_items', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_stock_items_tree_parent_id'), 'cmf_stock_items', ['tree_parent_id'], unique=False)
    op.add_column('cmf_stock_operations', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_stock_operations', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_stock_operations', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_stock_operations', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_stock_operations_tree_parent_id'), 'cmf_stock_operations', ['tree_parent_id'], unique=False)
    op.add_column('cmf_subscription', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_subscription', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_subscription', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_subscription', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_subscription_tree_parent_id'), 'cmf_subscription', ['tree_parent_id'], unique=False)
    op.add_column('cmf_tag', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_tag', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_tag', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_tag', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_tag_tree_parent_id'), 'cmf_tag', ['tree_parent_id'], unique=False)
    op.add_column('cmf_tag_category', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_tag_category', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_tag_category', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_tag_category', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_tag_category_tree_parent_id'), 'cmf_tag_category', ['tree_parent_id'], unique=False)
    op.add_column('cmf_trigger', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_trigger', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_trigger', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_trigger', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_trigger_tree_parent_id'), 'cmf_trigger', ['tree_parent_id'], unique=False)
    op.add_column('cmf_unit', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_unit', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_unit', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_unit', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_unit_tree_parent_id'), 'cmf_unit', ['tree_parent_id'], unique=False)
    op.add_column('cmf_whatsapp', sa.Column('has_tree_nodes', sa.Boolean(), nullable=True))
    op.add_column('cmf_whatsapp', sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True))
    op.add_column('cmf_whatsapp', sa.Column('tree_hidden', sa.Boolean(), nullable=True))
    op.add_column('cmf_whatsapp', sa.Column('tree_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_whatsapp_tree_parent_id'), 'cmf_whatsapp', ['tree_parent_id'], unique=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_cmf_whatsapp_tree_parent_id'), table_name='cmf_whatsapp')
    op.drop_column('cmf_whatsapp', 'tree_parent_id')
    op.drop_column('cmf_whatsapp', 'tree_hidden')
    op.drop_column('cmf_whatsapp', 'tree_node_is_branch')
    op.drop_column('cmf_whatsapp', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_unit_tree_parent_id'), table_name='cmf_unit')
    op.drop_column('cmf_unit', 'tree_parent_id')
    op.drop_column('cmf_unit', 'tree_hidden')
    op.drop_column('cmf_unit', 'tree_node_is_branch')
    op.drop_column('cmf_unit', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_trigger_tree_parent_id'), table_name='cmf_trigger')
    op.drop_column('cmf_trigger', 'tree_parent_id')
    op.drop_column('cmf_trigger', 'tree_hidden')
    op.drop_column('cmf_trigger', 'tree_node_is_branch')
    op.drop_column('cmf_trigger', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_tag_category_tree_parent_id'), table_name='cmf_tag_category')
    op.drop_column('cmf_tag_category', 'tree_parent_id')
    op.drop_column('cmf_tag_category', 'tree_hidden')
    op.drop_column('cmf_tag_category', 'tree_node_is_branch')
    op.drop_column('cmf_tag_category', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_tag_tree_parent_id'), table_name='cmf_tag')
    op.drop_column('cmf_tag', 'tree_parent_id')
    op.drop_column('cmf_tag', 'tree_hidden')
    op.drop_column('cmf_tag', 'tree_node_is_branch')
    op.drop_column('cmf_tag', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_subscription_tree_parent_id'), table_name='cmf_subscription')
    op.drop_column('cmf_subscription', 'tree_parent_id')
    op.drop_column('cmf_subscription', 'tree_hidden')
    op.drop_column('cmf_subscription', 'tree_node_is_branch')
    op.drop_column('cmf_subscription', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_stock_operations_tree_parent_id'), table_name='cmf_stock_operations')
    op.drop_column('cmf_stock_operations', 'tree_parent_id')
    op.drop_column('cmf_stock_operations', 'tree_hidden')
    op.drop_column('cmf_stock_operations', 'tree_node_is_branch')
    op.drop_column('cmf_stock_operations', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_stock_items_tree_parent_id'), table_name='cmf_stock_items')
    op.drop_column('cmf_stock_items', 'tree_parent_id')
    op.drop_column('cmf_stock_items', 'tree_hidden')
    op.drop_column('cmf_stock_items', 'tree_node_is_branch')
    op.drop_column('cmf_stock_items', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_stock_tree_parent_id'), table_name='cmf_stock')
    op.drop_column('cmf_stock', 'tree_parent_id')
    op.drop_column('cmf_stock', 'tree_hidden')
    op.drop_column('cmf_stock', 'tree_node_is_branch')
    op.drop_column('cmf_stock', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_status_opt_tree_parent_id'), table_name='cmf_status_opt')
    op.drop_column('cmf_status_opt', 'tree_parent_id')
    op.drop_column('cmf_status_opt', 'tree_hidden')
    op.drop_column('cmf_status_opt', 'tree_node_is_branch')
    op.drop_column('cmf_status_opt', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_status_tree_parent_id'), table_name='cmf_status')
    op.drop_column('cmf_status', 'tree_parent_id')
    op.drop_column('cmf_status', 'tree_hidden')
    op.drop_column('cmf_status', 'tree_node_is_branch')
    op.drop_column('cmf_status', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_staff_control_settings_tree_parent_id'), table_name='cmf_staff_control_settings')
    op.drop_column('cmf_staff_control_settings', 'tree_parent_id')
    op.drop_column('cmf_staff_control_settings', 'tree_hidden')
    op.drop_column('cmf_staff_control_settings', 'tree_node_is_branch')
    op.drop_column('cmf_staff_control_settings', 'has_tree_nodes')
    op.drop_column('cmf_role', 'tree_hidden')
    op.drop_column('cmf_role', 'tree_node_is_branch')
    op.drop_column('cmf_role', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_product_tree_parent_id'), table_name='cmf_product')
    op.drop_column('cmf_product', 'tree_parent_id')
    op.drop_column('cmf_product', 'tree_hidden')
    op.drop_column('cmf_product', 'tree_node_is_branch')
    op.drop_column('cmf_product', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_print_tmpl_tree_parent_id'), table_name='cmf_print_tmpl')
    op.drop_column('cmf_print_tmpl', 'tree_parent_id')
    op.drop_column('cmf_print_tmpl', 'tree_hidden')
    op.drop_column('cmf_print_tmpl', 'tree_node_is_branch')
    op.drop_column('cmf_print_tmpl', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_price_tree_parent_id'), table_name='cmf_price')
    op.drop_column('cmf_price', 'tree_parent_id')
    op.drop_column('cmf_price', 'tree_hidden')
    op.drop_column('cmf_price', 'tree_node_is_branch')
    op.drop_column('cmf_price', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_plugin_zadarma_tree_parent_id'), table_name='cmf_plugin_zadarma')
    op.drop_column('cmf_plugin_zadarma', 'tree_parent_id')
    op.drop_column('cmf_plugin_zadarma', 'tree_hidden')
    op.drop_column('cmf_plugin_zadarma', 'tree_node_is_branch')
    op.drop_column('cmf_plugin_zadarma', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_plugin_trello_tree_parent_id'), table_name='cmf_plugin_trello')
    op.drop_column('cmf_plugin_trello', 'tree_parent_id')
    op.drop_column('cmf_plugin_trello', 'tree_hidden')
    op.drop_column('cmf_plugin_trello', 'tree_node_is_branch')
    op.drop_column('cmf_plugin_trello', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_plugin_telphin_tree_parent_id'), table_name='cmf_plugin_telphin')
    op.drop_column('cmf_plugin_telphin', 'tree_parent_id')
    op.drop_column('cmf_plugin_telphin', 'tree_hidden')
    op.drop_column('cmf_plugin_telphin', 'tree_node_is_branch')
    op.drop_column('cmf_plugin_telphin', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_plugin_s_m_s_gate_tree_parent_id'), table_name='cmf_plugin_s_m_s_gate')
    op.drop_column('cmf_plugin_s_m_s_gate', 'tree_parent_id')
    op.drop_column('cmf_plugin_s_m_s_gate', 'tree_hidden')
    op.drop_column('cmf_plugin_s_m_s_gate', 'tree_node_is_branch')
    op.drop_column('cmf_plugin_s_m_s_gate', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_plugin_mail_box_tree_parent_id'), table_name='cmf_plugin_mail_box')
    op.drop_column('cmf_plugin_mail_box', 'tree_parent_id')
    op.drop_column('cmf_plugin_mail_box', 'tree_hidden')
    op.drop_column('cmf_plugin_mail_box', 'tree_node_is_branch')
    op.drop_column('cmf_plugin_mail_box', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_plugin_jira_tree_parent_id'), table_name='cmf_plugin_jira')
    op.drop_column('cmf_plugin_jira', 'tree_parent_id')
    op.drop_column('cmf_plugin_jira', 'tree_hidden')
    op.drop_column('cmf_plugin_jira', 'tree_node_is_branch')
    op.drop_column('cmf_plugin_jira', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_plugin_confluence_tree_parent_id'), table_name='cmf_plugin_confluence')
    op.drop_column('cmf_plugin_confluence', 'tree_parent_id')
    op.drop_column('cmf_plugin_confluence', 'tree_hidden')
    op.drop_column('cmf_plugin_confluence', 'tree_node_is_branch')
    op.drop_column('cmf_plugin_confluence', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_plugin_asana_tree_parent_id'), table_name='cmf_plugin_asana')
    op.drop_column('cmf_plugin_asana', 'tree_parent_id')
    op.drop_column('cmf_plugin_asana', 'tree_hidden')
    op.drop_column('cmf_plugin_asana', 'tree_node_is_branch')
    op.drop_column('cmf_plugin_asana', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_plugin_tree_parent_id'), table_name='cmf_plugin')
    op.drop_column('cmf_plugin', 'tree_parent_id')
    op.drop_column('cmf_plugin', 'tree_hidden')
    op.drop_column('cmf_plugin', 'tree_node_is_branch')
    op.drop_column('cmf_plugin', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_plan_tree_parent_id'), table_name='cmf_plan')
    op.drop_column('cmf_plan', 'tree_parent_id')
    op.drop_column('cmf_plan', 'tree_hidden')
    op.drop_column('cmf_plan', 'tree_node_is_branch')
    op.drop_column('cmf_plan', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_person_var_tree_parent_id'), table_name='cmf_person_var')
    op.drop_column('cmf_person_var', 'tree_parent_id')
    op.drop_column('cmf_person_var', 'tree_hidden')
    op.drop_column('cmf_person_var', 'tree_node_is_branch')
    op.drop_column('cmf_person_var', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_person_group_tree_parent_id'), table_name='cmf_person_group')
    op.drop_column('cmf_person_group', 'tree_parent_id')
    op.drop_column('cmf_person_group', 'tree_hidden')
    op.drop_column('cmf_person_group', 'tree_node_is_branch')
    op.drop_column('cmf_person_group', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_person_tree_parent_id'), table_name='cmf_person')
    op.drop_column('cmf_person', 'tree_parent_id')
    op.drop_column('cmf_person', 'tree_hidden')
    op.drop_column('cmf_person', 'tree_node_is_branch')
    op.drop_column('cmf_person', 'has_tree_nodes')
    op.drop_column('cmf_org_unit', 'tree_hidden')
    op.drop_column('cmf_org_unit', 'tree_node_is_branch')
    op.drop_column('cmf_org_unit', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_notify_tree_parent_id'), table_name='cmf_notify')
    op.drop_column('cmf_notify', 'tree_parent_id')
    op.drop_column('cmf_notify', 'tree_hidden')
    op.drop_column('cmf_notify', 'tree_node_is_branch')
    op.drop_column('cmf_notify', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_menu_tree_tree_parent_id'), table_name='cmf_menu_tree')
    op.drop_column('cmf_menu_tree', 'tree_parent_id')
    op.drop_column('cmf_menu_tree', 'tree_hidden')
    op.drop_column('cmf_menu_tree', 'tree_node_is_branch')
    op.drop_column('cmf_menu_tree', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_menu_item_tree_parent_id'), table_name='cmf_menu_item')
    op.drop_column('cmf_menu_item', 'tree_parent_id')
    op.drop_column('cmf_menu_item', 'tree_hidden')
    op.drop_column('cmf_menu_item', 'tree_node_is_branch')
    op.drop_column('cmf_menu_item', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_mailbox_tree_parent_id'), table_name='cmf_mailbox')
    op.drop_column('cmf_mailbox', 'tree_parent_id')
    op.drop_column('cmf_mailbox', 'tree_hidden')
    op.drop_column('cmf_mailbox', 'tree_node_is_branch')
    op.drop_column('cmf_mailbox', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_mail_template_tree_parent_id'), table_name='cmf_mail_template')
    op.drop_column('cmf_mail_template', 'tree_parent_id')
    op.drop_column('cmf_mail_template', 'tree_hidden')
    op.drop_column('cmf_mail_template', 'tree_node_is_branch')
    op.drop_column('cmf_mail_template', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_mail_signature_tree_parent_id'), table_name='cmf_mail_signature')
    op.drop_column('cmf_mail_signature', 'tree_parent_id')
    op.drop_column('cmf_mail_signature', 'tree_hidden')
    op.drop_column('cmf_mail_signature', 'tree_node_is_branch')
    op.drop_column('cmf_mail_signature', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_link_tree_parent_id'), table_name='cmf_link')
    op.drop_column('cmf_link', 'tree_parent_id')
    op.drop_column('cmf_link', 'tree_hidden')
    op.drop_column('cmf_link', 'tree_node_is_branch')
    op.drop_column('cmf_link', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_lead_mailbox_tree_parent_id'), table_name='cmf_lead_mailbox')
    op.drop_column('cmf_lead_mailbox', 'tree_parent_id')
    op.drop_column('cmf_lead_mailbox', 'tree_hidden')
    op.drop_column('cmf_lead_mailbox', 'tree_node_is_branch')
    op.drop_column('cmf_lead_mailbox', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_job_tree_parent_id'), table_name='cmf_job')
    op.drop_column('cmf_job', 'tree_parent_id')
    op.drop_column('cmf_job', 'tree_hidden')
    op.drop_column('cmf_job', 'tree_node_is_branch')
    op.drop_column('cmf_job', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_invoice_items_tree_parent_id'), table_name='cmf_invoice_items')
    op.drop_column('cmf_invoice_items', 'tree_parent_id')
    op.drop_column('cmf_invoice_items', 'tree_hidden')
    op.drop_column('cmf_invoice_items', 'tree_node_is_branch')
    op.drop_column('cmf_invoice_items', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_integration_tree_parent_id'), table_name='cmf_integration')
    op.drop_column('cmf_integration', 'tree_parent_id')
    op.drop_column('cmf_integration', 'tree_hidden')
    op.drop_column('cmf_integration', 'tree_node_is_branch')
    op.drop_column('cmf_integration', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_import_tree_parent_id'), table_name='cmf_import')
    op.drop_column('cmf_import', 'tree_parent_id')
    op.drop_column('cmf_import', 'tree_hidden')
    op.drop_column('cmf_import', 'tree_node_is_branch')
    op.drop_column('cmf_import', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_form_field_tree_parent_id'), table_name='cmf_form_field')
    op.drop_column('cmf_form_field', 'tree_parent_id')
    op.drop_column('cmf_form_field', 'tree_hidden')
    op.drop_column('cmf_form_field', 'tree_node_is_branch')
    op.drop_column('cmf_form_field', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_form_tree_parent_id'), table_name='cmf_form')
    op.drop_column('cmf_form', 'tree_parent_id')
    op.drop_column('cmf_form', 'tree_hidden')
    op.drop_column('cmf_form', 'tree_node_is_branch')
    op.drop_column('cmf_form', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_filter_tree_parent_id'), table_name='cmf_filter')
    op.drop_column('cmf_filter', 'tree_parent_id')
    op.drop_column('cmf_filter', 'tree_hidden')
    op.drop_column('cmf_filter', 'tree_node_is_branch')
    op.drop_column('cmf_filter', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_document_history_tree_parent_id'), table_name='cmf_document_history')
    op.drop_column('cmf_document_history', 'tree_parent_id')
    op.drop_column('cmf_document_history', 'tree_hidden')
    op.drop_column('cmf_document_history', 'tree_node_is_branch')
    op.drop_column('cmf_document_history', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_deal_items_tree_parent_id'), table_name='cmf_deal_items')
    op.drop_column('cmf_deal_items', 'tree_parent_id')
    op.drop_column('cmf_deal_items', 'tree_hidden')
    op.drop_column('cmf_deal_items', 'tree_node_is_branch')
    op.drop_column('cmf_deal_items', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_currency_tree_parent_id'), table_name='cmf_currency')
    op.drop_column('cmf_currency', 'tree_parent_id')
    op.drop_column('cmf_currency', 'tree_hidden')
    op.drop_column('cmf_currency', 'tree_node_is_branch')
    op.drop_column('cmf_currency', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_contract_tree_parent_id'), table_name='cmf_contract')
    op.drop_column('cmf_contract', 'tree_parent_id')
    op.drop_column('cmf_contract', 'tree_hidden')
    op.drop_column('cmf_contract', 'tree_node_is_branch')
    op.drop_column('cmf_contract', 'has_tree_nodes')
    op.drop_column('cmf_comment', 'tree_hidden')
    op.drop_column('cmf_comment', 'tree_node_is_branch')
    op.drop_column('cmf_comment', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_chat_message_tree_parent_id'), table_name='cmf_chat_message')
    op.drop_column('cmf_chat_message', 'tree_parent_id')
    op.drop_column('cmf_chat_message', 'tree_hidden')
    op.drop_column('cmf_chat_message', 'tree_node_is_branch')
    op.drop_column('cmf_chat_message', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_card_tree_parent_id'), table_name='cmf_card')
    op.drop_column('cmf_card', 'tree_parent_id')
    op.drop_column('cmf_card', 'tree_hidden')
    op.drop_column('cmf_card', 'tree_node_is_branch')
    op.drop_column('cmf_card', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_balance_operation_tree_parent_id'), table_name='cmf_balance_operation')
    op.drop_column('cmf_balance_operation', 'tree_parent_id')
    op.drop_column('cmf_balance_operation', 'tree_hidden')
    op.drop_column('cmf_balance_operation', 'tree_node_is_branch')
    op.drop_column('cmf_balance_operation', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_balance_tree_parent_id'), table_name='cmf_balance')
    op.drop_column('cmf_balance', 'tree_parent_id')
    op.drop_column('cmf_balance', 'tree_hidden')
    op.drop_column('cmf_balance', 'tree_node_is_branch')
    op.drop_column('cmf_balance', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_attachment_tree_parent_id'), table_name='cmf_attachment')
    op.drop_column('cmf_attachment', 'tree_parent_id')
    op.drop_column('cmf_attachment', 'tree_hidden')
    op.drop_column('cmf_attachment', 'tree_node_is_branch')
    op.drop_column('cmf_attachment', 'has_tree_nodes')
    op.drop_index(op.f('ix_cmf_activity_tree_parent_id'), table_name='cmf_activity')
    op.drop_column('cmf_activity', 'tree_parent_id')
    op.drop_column('cmf_activity', 'tree_hidden')
    op.drop_column('cmf_activity', 'tree_node_is_branch')
    op.drop_column('cmf_activity', 'has_tree_nodes')
    # ### end Alembic commands ###
