"""import model

Revision ID: 8aa0e53e0b28
Revises: 6698abae25d0
Create Date: 2021-05-24 14:00:23.838968

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '8aa0e53e0b28'
down_revision = '6698abae25d0'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('cmf_import',
    sa.Column('cache_last_comments', sa.TEXT(), nullable=False),
    sa.Column('cmf_author_id', sa.String(length=64), nullable=True),
    sa.Column('cmf_created_at', sa.TIMESTAMP(timezone=True), nullable=False),
    sa.Column('cmf_deleted', sa.Boolean(), nullable=False),
    sa.Column('cmf_import_id', sa.String(length=64), nullable=True),
    sa.Column('cmf_locked_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_locked_by_id', sa.String(length=64), nullable=True),
    sa.Column('cmf_modified_at', sa.TIMESTAMP(timezone=True), nullable=False),
    sa.Column('cmf_modified_by_id', sa.String(length=64), nullable=True),
    sa.Column('cmf_owner_assistant_id', sa.String(length=64), nullable=True),
    sa.Column('cmf_owner_id', sa.String(length=64), nullable=True),
    sa.Column('cmf_version', sa.Integer(), nullable=True),
    sa.Column('cmf_viewed_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('code', sa.String(length=64), nullable=True),
    sa.Column('error_msg', sa.TEXT(), nullable=True),
    sa.Column('id', sa.String(length=64), nullable=False),
    sa.Column('json_settings', sa.TEXT(), nullable=True),
    sa.Column('name', sa.String(length=256), nullable=True),
    sa.Column('parent_id', sa.String(length=64), nullable=True),
    sa.Column('status_id', sa.String(length=64), nullable=False),
    sa.Column('text', sa.TEXT(), nullable=True),
    sa.Column('type', sa.String(length=32), nullable=True),
    sa.ForeignKeyConstraint(['cmf_import_id'], ['cmf_import.id'], ),
    sa.ForeignKeyConstraint(['status_id'], ['cmf_status.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_import_cmf_author_id'), 'cmf_import', ['cmf_author_id'], unique=False)
    op.create_index(op.f('ix_cmf_import_cmf_created_at'), 'cmf_import', ['cmf_created_at'], unique=False)
    op.create_index(op.f('ix_cmf_import_cmf_deleted'), 'cmf_import', ['cmf_deleted'], unique=False)
    op.create_index(op.f('ix_cmf_import_cmf_import_id'), 'cmf_import', ['cmf_import_id'], unique=False)
    op.create_index(op.f('ix_cmf_import_cmf_locked_at'), 'cmf_import', ['cmf_locked_at'], unique=False)
    op.create_index(op.f('ix_cmf_import_cmf_locked_by_id'), 'cmf_import', ['cmf_locked_by_id'], unique=False)
    op.create_index(op.f('ix_cmf_import_cmf_modified_at'), 'cmf_import', ['cmf_modified_at'], unique=False)
    op.create_index(op.f('ix_cmf_import_cmf_modified_by_id'), 'cmf_import', ['cmf_modified_by_id'], unique=False)
    op.create_index(op.f('ix_cmf_import_cmf_owner_assistant_id'), 'cmf_import', ['cmf_owner_assistant_id'], unique=False)
    op.create_index(op.f('ix_cmf_import_cmf_owner_id'), 'cmf_import', ['cmf_owner_id'], unique=False)
    op.create_index(op.f('ix_cmf_import_cmf_version'), 'cmf_import', ['cmf_version'], unique=False)
    op.create_index(op.f('ix_cmf_import_cmf_viewed_at'), 'cmf_import', ['cmf_viewed_at'], unique=False)
    op.create_index(op.f('ix_cmf_import_code'), 'cmf_import', ['code'], unique=True)
    op.create_index(op.f('ix_cmf_import_name'), 'cmf_import', ['name'], unique=False)
    op.create_index(op.f('ix_cmf_import_parent_id'), 'cmf_import', ['parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_import_status_id'), 'cmf_import', ['status_id'], unique=False)
    op.add_column('cmf_active_entity_filter', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_active_entity_filter_cmf_import_id'), 'cmf_active_entity_filter', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_active_entity_filter', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_activity', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_activity_cmf_import_id'), 'cmf_activity', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_activity', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_attachment', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_attachment_cmf_import_id'), 'cmf_attachment', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_attachment', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_balance', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_balance_cmf_import_id'), 'cmf_balance', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_balance', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_balance_operation', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_balance_operation_cmf_import_id'), 'cmf_balance_operation', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_balance_operation', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_card', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_card_cmf_import_id'), 'cmf_card', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_card', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_channel_message', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_channel_message_cmf_import_id'), 'cmf_channel_message', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_channel_message', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_chat_group', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_chat_group_cmf_import_id'), 'cmf_chat_group', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_chat_group', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_chat_topic', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_chat_topic_cmf_import_id'), 'cmf_chat_topic', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_chat_topic', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_comment', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_comment_cmf_import_id'), 'cmf_comment', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_comment', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_company', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_company_cmf_import_id'), 'cmf_company', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_company', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_currency', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_currency_cmf_import_id'), 'cmf_currency', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_currency', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_deal', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_deal_cmf_import_id'), 'cmf_deal', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_deal', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_document', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_document_cmf_import_id'), 'cmf_document', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_document', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_feed', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_feed_cmf_import_id'), 'cmf_feed', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_feed', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_folder', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_folder_cmf_import_id'), 'cmf_folder', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_folder', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_form', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_form_cmf_import_id'), 'cmf_form', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_form', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_form_field', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_form_field_cmf_import_id'), 'cmf_form_field', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_form_field', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_integration', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_integration_cmf_import_id'), 'cmf_integration', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_integration', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_invoice', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_invoice_cmf_import_id'), 'cmf_invoice', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_invoice', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_invoice_items', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_invoice_items_cmf_import_id'), 'cmf_invoice_items', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_invoice_items', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_job', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_job_cmf_import_id'), 'cmf_job', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_job', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_lead', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_lead_cmf_import_id'), 'cmf_lead', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_lead', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_list', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_list_cmf_import_id'), 'cmf_list', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_list', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_mail', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_mail_cmf_import_id'), 'cmf_mail', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_mail', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_mail_signature', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_mail_signature_cmf_import_id'), 'cmf_mail_signature', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_mail_signature', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_mail_template', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_mail_template_cmf_import_id'), 'cmf_mail_template', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_mail_template', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_mailbox', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_mailbox_cmf_import_id'), 'cmf_mailbox', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_mailbox', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_notify', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_notify_cmf_import_id'), 'cmf_notify', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_notify', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_org_unit', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_org_unit_cmf_import_id'), 'cmf_org_unit', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_org_unit', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_payment', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_payment_cmf_import_id'), 'cmf_payment', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_payment', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_person', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_person_cmf_import_id'), 'cmf_person', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_person', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_person_group', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_person_group_cmf_import_id'), 'cmf_person_group', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_person_group', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_pipeline', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_pipeline_cmf_import_id'), 'cmf_pipeline', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_pipeline', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_plan', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_plan_cmf_import_id'), 'cmf_plan', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_plan', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_price', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_price_cmf_import_id'), 'cmf_price', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_price', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_print_tmpl', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_print_tmpl_cmf_import_id'), 'cmf_print_tmpl', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_print_tmpl', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_product', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_product_cmf_import_id'), 'cmf_product', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_product', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_project', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_project_cmf_import_id'), 'cmf_project', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_project', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_purchase_order', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_purchase_order_cmf_import_id'), 'cmf_purchase_order', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_purchase_order', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_purchase_order_items', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_purchase_order_items_cmf_import_id'), 'cmf_purchase_order_items', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_purchase_order_items', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_role', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_role_cmf_import_id'), 'cmf_role', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_role', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_sales_order', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_sales_order_cmf_import_id'), 'cmf_sales_order', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_sales_order', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_sales_order_items', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_sales_order_items_cmf_import_id'), 'cmf_sales_order_items', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_sales_order_items', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_staff_control', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_staff_control_cmf_import_id'), 'cmf_staff_control', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_staff_control', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_staff_control_settings', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_staff_control_settings_cmf_import_id'), 'cmf_staff_control_settings', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_staff_control_settings', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_status', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_status_cmf_import_id'), 'cmf_status', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_status', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_status_opt', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_status_opt_cmf_import_id'), 'cmf_status_opt', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_status_opt', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_stock', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_stock_cmf_import_id'), 'cmf_stock', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_stock', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_stock_items', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_stock_items_cmf_import_id'), 'cmf_stock_items', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_stock_items', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_stock_move', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_stock_move_cmf_import_id'), 'cmf_stock_move', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_stock_move', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_stock_move_items', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_stock_move_items_cmf_import_id'), 'cmf_stock_move_items', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_stock_move_items', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_stock_operations', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_stock_operations_cmf_import_id'), 'cmf_stock_operations', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_stock_operations', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_subscription', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_subscription_cmf_import_id'), 'cmf_subscription', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_subscription', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_tag', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_tag_cmf_import_id'), 'cmf_tag', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_tag', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_task', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_task_cmf_import_id'), 'cmf_task', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_task', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_trigger', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_trigger_cmf_import_id'), 'cmf_trigger', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_trigger', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_u_work_post', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_u_work_post_cmf_import_id'), 'cmf_u_work_post', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_u_work_post', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_unit', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_unit_cmf_import_id'), 'cmf_unit', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_unit', 'cmf_import', ['cmf_import_id'], ['id'])
    op.add_column('cmf_whatsapp', sa.Column('cmf_import_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_whatsapp_cmf_import_id'), 'cmf_whatsapp', ['cmf_import_id'], unique=False)
    op.create_foreign_key(None, 'cmf_whatsapp', 'cmf_import', ['cmf_import_id'], ['id'])
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'cmf_whatsapp', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_whatsapp_cmf_import_id'), table_name='cmf_whatsapp')
    op.drop_column('cmf_whatsapp', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_unit', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_unit_cmf_import_id'), table_name='cmf_unit')
    op.drop_column('cmf_unit', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_u_work_post', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_u_work_post_cmf_import_id'), table_name='cmf_u_work_post')
    op.drop_column('cmf_u_work_post', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_trigger', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_trigger_cmf_import_id'), table_name='cmf_trigger')
    op.drop_column('cmf_trigger', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_task', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_task_cmf_import_id'), table_name='cmf_task')
    op.drop_column('cmf_task', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_tag', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_tag_cmf_import_id'), table_name='cmf_tag')
    op.drop_column('cmf_tag', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_subscription', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_subscription_cmf_import_id'), table_name='cmf_subscription')
    op.drop_column('cmf_subscription', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_stock_operations', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_stock_operations_cmf_import_id'), table_name='cmf_stock_operations')
    op.drop_column('cmf_stock_operations', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_stock_move_items', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_stock_move_items_cmf_import_id'), table_name='cmf_stock_move_items')
    op.drop_column('cmf_stock_move_items', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_stock_move', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_stock_move_cmf_import_id'), table_name='cmf_stock_move')
    op.drop_column('cmf_stock_move', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_stock_items', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_stock_items_cmf_import_id'), table_name='cmf_stock_items')
    op.drop_column('cmf_stock_items', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_stock', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_stock_cmf_import_id'), table_name='cmf_stock')
    op.drop_column('cmf_stock', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_status_opt', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_status_opt_cmf_import_id'), table_name='cmf_status_opt')
    op.drop_column('cmf_status_opt', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_status', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_status_cmf_import_id'), table_name='cmf_status')
    op.drop_column('cmf_status', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_staff_control_settings', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_staff_control_settings_cmf_import_id'), table_name='cmf_staff_control_settings')
    op.drop_column('cmf_staff_control_settings', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_staff_control', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_staff_control_cmf_import_id'), table_name='cmf_staff_control')
    op.drop_column('cmf_staff_control', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_sales_order_items', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_sales_order_items_cmf_import_id'), table_name='cmf_sales_order_items')
    op.drop_column('cmf_sales_order_items', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_sales_order', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_sales_order_cmf_import_id'), table_name='cmf_sales_order')
    op.drop_column('cmf_sales_order', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_role', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_role_cmf_import_id'), table_name='cmf_role')
    op.drop_column('cmf_role', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_purchase_order_items', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_purchase_order_items_cmf_import_id'), table_name='cmf_purchase_order_items')
    op.drop_column('cmf_purchase_order_items', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_purchase_order', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_purchase_order_cmf_import_id'), table_name='cmf_purchase_order')
    op.drop_column('cmf_purchase_order', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_project', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_project_cmf_import_id'), table_name='cmf_project')
    op.drop_column('cmf_project', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_product', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_product_cmf_import_id'), table_name='cmf_product')
    op.drop_column('cmf_product', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_print_tmpl', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_print_tmpl_cmf_import_id'), table_name='cmf_print_tmpl')
    op.drop_column('cmf_print_tmpl', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_price', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_price_cmf_import_id'), table_name='cmf_price')
    op.drop_column('cmf_price', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_plan', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_plan_cmf_import_id'), table_name='cmf_plan')
    op.drop_column('cmf_plan', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_pipeline', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_pipeline_cmf_import_id'), table_name='cmf_pipeline')
    op.drop_column('cmf_pipeline', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_person_group', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_person_group_cmf_import_id'), table_name='cmf_person_group')
    op.drop_column('cmf_person_group', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_person', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_person_cmf_import_id'), table_name='cmf_person')
    op.drop_column('cmf_person', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_payment', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_payment_cmf_import_id'), table_name='cmf_payment')
    op.drop_column('cmf_payment', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_org_unit', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_org_unit_cmf_import_id'), table_name='cmf_org_unit')
    op.drop_column('cmf_org_unit', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_notify', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_notify_cmf_import_id'), table_name='cmf_notify')
    op.drop_column('cmf_notify', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_mailbox', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_mailbox_cmf_import_id'), table_name='cmf_mailbox')
    op.drop_column('cmf_mailbox', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_mail_template', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_mail_template_cmf_import_id'), table_name='cmf_mail_template')
    op.drop_column('cmf_mail_template', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_mail_signature', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_mail_signature_cmf_import_id'), table_name='cmf_mail_signature')
    op.drop_column('cmf_mail_signature', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_mail', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_mail_cmf_import_id'), table_name='cmf_mail')
    op.drop_column('cmf_mail', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_list', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_list_cmf_import_id'), table_name='cmf_list')
    op.drop_column('cmf_list', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_lead', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_lead_cmf_import_id'), table_name='cmf_lead')
    op.drop_column('cmf_lead', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_job', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_job_cmf_import_id'), table_name='cmf_job')
    op.drop_column('cmf_job', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_invoice_items', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_invoice_items_cmf_import_id'), table_name='cmf_invoice_items')
    op.drop_column('cmf_invoice_items', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_invoice', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_invoice_cmf_import_id'), table_name='cmf_invoice')
    op.drop_column('cmf_invoice', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_integration', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_integration_cmf_import_id'), table_name='cmf_integration')
    op.drop_column('cmf_integration', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_form_field', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_form_field_cmf_import_id'), table_name='cmf_form_field')
    op.drop_column('cmf_form_field', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_form', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_form_cmf_import_id'), table_name='cmf_form')
    op.drop_column('cmf_form', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_folder', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_folder_cmf_import_id'), table_name='cmf_folder')
    op.drop_column('cmf_folder', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_feed', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_feed_cmf_import_id'), table_name='cmf_feed')
    op.drop_column('cmf_feed', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_document', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_document_cmf_import_id'), table_name='cmf_document')
    op.drop_column('cmf_document', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_deal', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_deal_cmf_import_id'), table_name='cmf_deal')
    op.drop_column('cmf_deal', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_currency', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_currency_cmf_import_id'), table_name='cmf_currency')
    op.drop_column('cmf_currency', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_company', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_company_cmf_import_id'), table_name='cmf_company')
    op.drop_column('cmf_company', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_comment', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_comment_cmf_import_id'), table_name='cmf_comment')
    op.drop_column('cmf_comment', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_chat_topic', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_chat_topic_cmf_import_id'), table_name='cmf_chat_topic')
    op.drop_column('cmf_chat_topic', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_chat_group', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_chat_group_cmf_import_id'), table_name='cmf_chat_group')
    op.drop_column('cmf_chat_group', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_channel_message', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_channel_message_cmf_import_id'), table_name='cmf_channel_message')
    op.drop_column('cmf_channel_message', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_card', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_card_cmf_import_id'), table_name='cmf_card')
    op.drop_column('cmf_card', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_balance_operation', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_balance_operation_cmf_import_id'), table_name='cmf_balance_operation')
    op.drop_column('cmf_balance_operation', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_balance', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_balance_cmf_import_id'), table_name='cmf_balance')
    op.drop_column('cmf_balance', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_attachment', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_attachment_cmf_import_id'), table_name='cmf_attachment')
    op.drop_column('cmf_attachment', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_activity', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_activity_cmf_import_id'), table_name='cmf_activity')
    op.drop_column('cmf_activity', 'cmf_import_id')
    op.drop_constraint(None, 'cmf_active_entity_filter', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_active_entity_filter_cmf_import_id'), table_name='cmf_active_entity_filter')
    op.drop_column('cmf_active_entity_filter', 'cmf_import_id')
    op.drop_index(op.f('ix_cmf_import_status_id'), table_name='cmf_import')
    op.drop_index(op.f('ix_cmf_import_parent_id'), table_name='cmf_import')
    op.drop_index(op.f('ix_cmf_import_name'), table_name='cmf_import')
    op.drop_index(op.f('ix_cmf_import_code'), table_name='cmf_import')
    op.drop_index(op.f('ix_cmf_import_cmf_viewed_at'), table_name='cmf_import')
    op.drop_index(op.f('ix_cmf_import_cmf_version'), table_name='cmf_import')
    op.drop_index(op.f('ix_cmf_import_cmf_owner_id'), table_name='cmf_import')
    op.drop_index(op.f('ix_cmf_import_cmf_owner_assistant_id'), table_name='cmf_import')
    op.drop_index(op.f('ix_cmf_import_cmf_modified_by_id'), table_name='cmf_import')
    op.drop_index(op.f('ix_cmf_import_cmf_modified_at'), table_name='cmf_import')
    op.drop_index(op.f('ix_cmf_import_cmf_locked_by_id'), table_name='cmf_import')
    op.drop_index(op.f('ix_cmf_import_cmf_locked_at'), table_name='cmf_import')
    op.drop_index(op.f('ix_cmf_import_cmf_import_id'), table_name='cmf_import')
    op.drop_index(op.f('ix_cmf_import_cmf_deleted'), table_name='cmf_import')
    op.drop_index(op.f('ix_cmf_import_cmf_created_at'), table_name='cmf_import')
    op.drop_index(op.f('ix_cmf_import_cmf_author_id'), table_name='cmf_import')
    op.drop_table('cmf_import')
    # ### end Alembic commands ###
