"""cust_field

Revision ID: 69198d474142
Revises: fb76cea73c18
Create Date: 2024-04-10 13:45:33.233386

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '69198d474142'
down_revision = 'fb76cea73c18'
branch_labels = None
depends_on = None


def upgrade():
    op.create_table('cmf_ui_form_group',
    sa.Column('id', sa.String(length=64), nullable=False),
    sa.Column('cmf_locked_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_created_at', sa.TIMESTAMP(timezone=True), nullable=False),
    sa.Column('cmf_modified_at', sa.TIMESTAMP(timezone=True), nullable=False),
    sa.Column('cmf_viewed_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_deleted', sa.Boolean(), nullable=False),
    sa.Column('cmf_version', sa.BIGINT(), nullable=True),
    sa.Column('name', sa.String(length=256), nullable=True),
    sa.Column('code', sa.String(length=64), nullable=True),
    sa.Column('system', sa.Boolean(), nullable=False),
    sa.Column('text', sa.TEXT(), nullable=True),
    sa.Column('import_original', sa.Boolean(), nullable=True),
    sa.Column('import_raw_json', sa.TEXT(), nullable=True),
    sa.Column('ext_id', sa.String(), nullable=True),
    sa.Column('cmf_archived', sa.Boolean(), nullable=False),
    sa.Column('is_favorite', sa.Boolean(), nullable=True),
    sa.Column('has_tree_nodes', sa.Boolean(), nullable=True),
    sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True),
    sa.Column('tree_hidden', sa.Boolean(), nullable=True),
    sa.Column('orderno', sa.Integer(), nullable=True),
    sa.Column('perm_public', sa.Boolean(), nullable=True),
    sa.Column('perm_has_acl', sa.Boolean(), nullable=True),
    sa.Column('perm_inherit', sa.Boolean(), nullable=True),
    sa.Column('perm_parent_owner_id', sa.String(length=64), nullable=True),
    sa.Column('perm_inherit_acl_id', sa.String(length=64), nullable=True),
    sa.Column('perm_effective_acl_id', sa.String(length=64), nullable=True),
    sa.Column('perm_security_level_allowed_ids_cache', sa.TEXT(), nullable=True),
    sa.Column('perm_encrypt', sa.Boolean(), nullable=True),
    sa.Column('action', sa.String(length=32), nullable=False),
    sa.Column('params', sa.TEXT(), nullable=False),
    sa.Column('type', sa.String(length=32), nullable=False),
    sa.Column('hidden', sa.Boolean(), nullable=False),
    sa.Column('cmf_author_id', sa.String(length=64), nullable=True),
    sa.Column('cmf_owner_id', sa.String(length=64), nullable=True),
    sa.Column('parent_id', sa.String(length=64), nullable=True),
    sa.Column('cmf_modified_by_id', sa.String(length=64), nullable=True),
    sa.Column('cmf_locked_by_id', sa.String(length=64), nullable=True),
    sa.Column('cmf_import_id', sa.String(length=64), nullable=True),
    sa.Column('tree_parent_id', sa.String(length=64), nullable=True),
    sa.Column('root_parent_id', sa.String(length=64), nullable=True),
    sa.Column('project_id', sa.String(length=64), nullable=True),
    sa.Column('perm_acl_id', sa.String(length=64), nullable=True),
    sa.Column('perm_parent_id', sa.String(length=64), nullable=True),
    sa.ForeignKeyConstraint(['cmf_import_id'], ['cmf_import.id'], ),
    sa.ForeignKeyConstraint(['parent_id'], ['cmf_ui_form.id'], ),
    sa.ForeignKeyConstraint(['perm_acl_id'], ['cmf_access_list.id'], ),
    sa.ForeignKeyConstraint(['project_id'], ['cmf_project.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('cmf_cust_field_conf_scheme',
    sa.Column('id', sa.String(length=64), nullable=False),
    sa.Column('cmf_locked_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_created_at', sa.TIMESTAMP(timezone=True), nullable=False),
    sa.Column('cmf_modified_at', sa.TIMESTAMP(timezone=True), nullable=False),
    sa.Column('cmf_viewed_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_deleted', sa.Boolean(), nullable=False),
    sa.Column('cmf_version', sa.BIGINT(), nullable=True),
    sa.Column('name', sa.String(length=256), nullable=True),
    sa.Column('code', sa.String(length=64), nullable=True),
    sa.Column('system', sa.Boolean(), nullable=False),
    sa.Column('text', sa.TEXT(), nullable=True),
    sa.Column('import_original', sa.Boolean(), nullable=True),
    sa.Column('import_raw_json', sa.TEXT(), nullable=True),
    sa.Column('ext_id', sa.String(), nullable=True),
    sa.Column('cmf_archived', sa.Boolean(), nullable=False),
    sa.Column('is_favorite', sa.Boolean(), nullable=True),
    sa.Column('has_tree_nodes', sa.Boolean(), nullable=True),
    sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True),
    sa.Column('tree_hidden', sa.Boolean(), nullable=True),
    sa.Column('orderno', sa.Integer(), nullable=True),
    sa.Column('perm_public', sa.Boolean(), nullable=True),
    sa.Column('perm_has_acl', sa.Boolean(), nullable=True),
    sa.Column('perm_inherit', sa.Boolean(), nullable=True),
    sa.Column('perm_parent_owner_id', sa.String(length=64), nullable=True),
    sa.Column('perm_inherit_acl_id', sa.String(length=64), nullable=True),
    sa.Column('perm_effective_acl_id', sa.String(length=64), nullable=True),
    sa.Column('perm_security_level_allowed_ids_cache', sa.TEXT(), nullable=True),
    sa.Column('perm_encrypt', sa.Boolean(), nullable=True),
    sa.Column('cmf_author_id', sa.String(length=64), nullable=True),
    sa.Column('cmf_owner_id', sa.String(length=64), nullable=True),
    sa.Column('parent_id', sa.String(length=64), nullable=True),
    sa.Column('cmf_modified_by_id', sa.String(length=64), nullable=True),
    sa.Column('cmf_locked_by_id', sa.String(length=64), nullable=True),
    sa.Column('cmf_import_id', sa.String(length=64), nullable=True),
    sa.Column('tree_parent_id', sa.String(length=64), nullable=True),
    sa.Column('root_parent_id', sa.String(length=64), nullable=True),
    sa.Column('project_id', sa.String(length=64), nullable=True),
    sa.Column('perm_acl_id', sa.String(length=64), nullable=True),
    sa.Column('perm_parent_id', sa.String(length=64), nullable=True),
    sa.ForeignKeyConstraint(['cmf_import_id'], ['cmf_import.id'], ),
    sa.ForeignKeyConstraint(['perm_acl_id'], ['cmf_access_list.id'], ),
    sa.ForeignKeyConstraint(['project_id'], ['cmf_project.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('cmf_cust_field',
    sa.Column('id', sa.String(length=64), nullable=False),
    sa.Column('cmf_locked_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_created_at', sa.TIMESTAMP(timezone=True), nullable=False),
    sa.Column('cmf_modified_at', sa.TIMESTAMP(timezone=True), nullable=False),
    sa.Column('cmf_viewed_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_deleted', sa.Boolean(), nullable=False),
    sa.Column('cmf_version', sa.BIGINT(), nullable=True),
    sa.Column('name', sa.String(length=256), nullable=False),
    sa.Column('code', sa.String(length=64), nullable=True),
    sa.Column('system', sa.Boolean(), nullable=False),
    sa.Column('text', sa.TEXT(), nullable=True),
    sa.Column('import_original', sa.Boolean(), nullable=True),
    sa.Column('import_raw_json', sa.TEXT(), nullable=True),
    sa.Column('ext_id', sa.String(), nullable=True),
    sa.Column('cmf_archived', sa.Boolean(), nullable=False),
    sa.Column('is_favorite', sa.Boolean(), nullable=True),
    sa.Column('has_tree_nodes', sa.Boolean(), nullable=True),
    sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True),
    sa.Column('tree_hidden', sa.Boolean(), nullable=True),
    sa.Column('orderno', sa.Integer(), nullable=True),
    sa.Column('perm_public', sa.Boolean(), nullable=True),
    sa.Column('perm_has_acl', sa.Boolean(), nullable=True),
    sa.Column('perm_inherit', sa.Boolean(), nullable=True),
    sa.Column('perm_parent_owner_id', sa.String(length=64), nullable=True),
    sa.Column('perm_inherit_acl_id', sa.String(length=64), nullable=True),
    sa.Column('perm_effective_acl_id', sa.String(length=64), nullable=True),
    sa.Column('perm_security_level_allowed_ids_cache', sa.TEXT(), nullable=True),
    sa.Column('perm_encrypt', sa.Boolean(), nullable=True),
    sa.Column('dirty', sa.Boolean(), nullable=False),
    sa.Column('caption', sa.String(), nullable=False),
    sa.Column('cmf_model_name', sa.String(length=32), nullable=False),
    sa.Column('field_type', sa.String(length=256), nullable=False),
    sa.Column('widget', sa.String(length=256), nullable=False),
    sa.Column('field_custom_type', sa.Integer(), nullable=False),
    sa.Column('choices', sa.TEXT(), nullable=True),
    sa.Column('placeholder', sa.String(), nullable=False),
    sa.Column('comment', sa.String(), nullable=False),
    sa.Column('default', sa.String(), nullable=True),
    sa.Column('visible', sa.Boolean(), nullable=False),
    sa.Column('field_readonly', sa.Boolean(), nullable=False),
    sa.Column('disabled_choices', sa.TEXT(), nullable=False),
    sa.Column('models', sa.TEXT(), nullable=True),
    sa.Column('model', sa.String(length=256), nullable=True),
    sa.Column('left', sa.Boolean(), nullable=True),
    sa.Column('right', sa.Boolean(), nullable=True),
    sa.Column('required', sa.Boolean(), nullable=False),
    sa.Column('cmf_author_id', sa.String(length=64), nullable=True),
    sa.Column('cmf_owner_id', sa.String(length=64), nullable=True),
    sa.Column('parent_id', sa.String(length=64), nullable=True),
    sa.Column('cmf_modified_by_id', sa.String(length=64), nullable=True),
    sa.Column('cmf_locked_by_id', sa.String(length=64), nullable=True),
    sa.Column('cmf_import_id', sa.String(length=64), nullable=True),
    sa.Column('tree_parent_id', sa.String(length=64), nullable=True),
    sa.Column('root_parent_id', sa.String(length=64), nullable=True),
    sa.Column('project_id', sa.String(length=64), nullable=True),
    sa.Column('perm_acl_id', sa.String(length=64), nullable=True),
    sa.Column('perm_parent_id', sa.String(length=64), nullable=True),
    sa.ForeignKeyConstraint(['cmf_import_id'], ['cmf_import.id'], ),
    sa.ForeignKeyConstraint(['perm_acl_id'], ['cmf_access_list.id'], ),
    sa.ForeignKeyConstraint(['project_id'], ['cmf_project.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_cust_field_cmf_author_id'), 'cmf_cust_field', ['cmf_author_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_cmf_created_at'), 'cmf_cust_field', ['cmf_created_at'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_cmf_deleted'), 'cmf_cust_field', ['cmf_deleted'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_cmf_import_id'), 'cmf_cust_field', ['cmf_import_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_cmf_locked_at'), 'cmf_cust_field', ['cmf_locked_at'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_cmf_locked_by_id'), 'cmf_cust_field', ['cmf_locked_by_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_cmf_modified_at'), 'cmf_cust_field', ['cmf_modified_at'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_cmf_modified_by_id'), 'cmf_cust_field', ['cmf_modified_by_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_cmf_owner_id'), 'cmf_cust_field', ['cmf_owner_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_cmf_version'), 'cmf_cust_field', ['cmf_version'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_cmf_viewed_at'), 'cmf_cust_field', ['cmf_viewed_at'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_code'), 'cmf_cust_field', ['code'], unique=True)
    op.create_index(op.f('ix_cmf_cust_field_name'), 'cmf_cust_field', ['name'], unique=True)
    op.create_index(op.f('ix_cmf_cust_field_orderno'), 'cmf_cust_field', ['orderno'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_parent_id'), 'cmf_cust_field', ['parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_perm_acl_id'), 'cmf_cust_field', ['perm_acl_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_perm_parent_id'), 'cmf_cust_field', ['perm_parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_project_id'), 'cmf_cust_field', ['project_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_root_parent_id'), 'cmf_cust_field', ['root_parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_tree_parent_id'), 'cmf_cust_field', ['tree_parent_id'], unique=False)
    op.create_table('cmf_cust_field_conf',
    sa.Column('id', sa.String(length=64), nullable=False),
    sa.Column('cmf_locked_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_created_at', sa.TIMESTAMP(timezone=True), nullable=False),
    sa.Column('cmf_modified_at', sa.TIMESTAMP(timezone=True), nullable=False),
    sa.Column('cmf_viewed_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_deleted', sa.Boolean(), nullable=False),
    sa.Column('cmf_version', sa.BIGINT(), nullable=True),
    sa.Column('name', sa.String(length=256), nullable=True),
    sa.Column('code', sa.String(length=64), nullable=True),
    sa.Column('system', sa.Boolean(), nullable=False),
    sa.Column('text', sa.TEXT(), nullable=True),
    sa.Column('import_original', sa.Boolean(), nullable=True),
    sa.Column('import_raw_json', sa.TEXT(), nullable=True),
    sa.Column('ext_id', sa.String(), nullable=True),
    sa.Column('cmf_archived', sa.Boolean(), nullable=False),
    sa.Column('is_favorite', sa.Boolean(), nullable=True),
    sa.Column('has_tree_nodes', sa.Boolean(), nullable=True),
    sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True),
    sa.Column('tree_hidden', sa.Boolean(), nullable=True),
    sa.Column('orderno', sa.Integer(), nullable=True),
    sa.Column('perm_public', sa.Boolean(), nullable=True),
    sa.Column('perm_has_acl', sa.Boolean(), nullable=True),
    sa.Column('perm_inherit', sa.Boolean(), nullable=True),
    sa.Column('perm_parent_owner_id', sa.String(length=64), nullable=True),
    sa.Column('perm_inherit_acl_id', sa.String(length=64), nullable=True),
    sa.Column('perm_effective_acl_id', sa.String(length=64), nullable=True),
    sa.Column('perm_security_level_allowed_ids_cache', sa.TEXT(), nullable=True),
    sa.Column('perm_encrypt', sa.Boolean(), nullable=True),
    sa.Column('cmf_author_id', sa.String(length=64), nullable=True),
    sa.Column('cmf_owner_id', sa.String(length=64), nullable=True),
    sa.Column('parent_id', sa.String(length=64), nullable=True),
    sa.Column('cmf_modified_by_id', sa.String(length=64), nullable=True),
    sa.Column('cmf_locked_by_id', sa.String(length=64), nullable=True),
    sa.Column('cmf_import_id', sa.String(length=64), nullable=True),
    sa.Column('tree_parent_id', sa.String(length=64), nullable=True),
    sa.Column('root_parent_id', sa.String(length=64), nullable=True),
    sa.Column('project_id', sa.String(length=64), nullable=True),
    sa.Column('perm_acl_id', sa.String(length=64), nullable=True),
    sa.Column('perm_parent_id', sa.String(length=64), nullable=True),
    sa.ForeignKeyConstraint(['cmf_import_id'], ['cmf_import.id'], ),
    sa.ForeignKeyConstraint(['perm_acl_id'], ['cmf_access_list.id'], ),
    sa.ForeignKeyConstraint(['project_id'], ['cmf_project.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_cust_field_conf_cmf_author_id'), 'cmf_cust_field_conf', ['cmf_author_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_cmf_created_at'), 'cmf_cust_field_conf', ['cmf_created_at'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_cmf_deleted'), 'cmf_cust_field_conf', ['cmf_deleted'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_cmf_import_id'), 'cmf_cust_field_conf', ['cmf_import_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_cmf_locked_at'), 'cmf_cust_field_conf', ['cmf_locked_at'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_cmf_locked_by_id'), 'cmf_cust_field_conf', ['cmf_locked_by_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_cmf_modified_at'), 'cmf_cust_field_conf', ['cmf_modified_at'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_cmf_modified_by_id'), 'cmf_cust_field_conf', ['cmf_modified_by_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_cmf_owner_id'), 'cmf_cust_field_conf', ['cmf_owner_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_cmf_version'), 'cmf_cust_field_conf', ['cmf_version'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_cmf_viewed_at'), 'cmf_cust_field_conf', ['cmf_viewed_at'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_code'), 'cmf_cust_field_conf', ['code'], unique=True)
    op.create_index(op.f('ix_cmf_cust_field_conf_name'), 'cmf_cust_field_conf', ['name'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_orderno'), 'cmf_cust_field_conf', ['orderno'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_parent_id'), 'cmf_cust_field_conf', ['parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_perm_acl_id'), 'cmf_cust_field_conf', ['perm_acl_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_perm_parent_id'), 'cmf_cust_field_conf', ['perm_parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_project_id'), 'cmf_cust_field_conf', ['project_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_root_parent_id'), 'cmf_cust_field_conf', ['root_parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_tree_parent_id'), 'cmf_cust_field_conf', ['tree_parent_id'], unique=False)
    op.create_table('cmf_cust_field_conf_cmf_cust_field_conf_scheme',
    sa.Column('id', sa.String(length=128), nullable=False),
    sa.Column('parent_id', sa.String(length=64), nullable=True),
    sa.Column('root_id', sa.String(length=64), nullable=True),
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('left_id', sa.String(length=64), nullable=True),
    sa.Column('right_id', sa.String(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.ForeignKeyConstraint(['left_id'], ['cmf_cust_field_conf.id'], ),
    sa.ForeignKeyConstraint(['right_id'], ['cmf_cust_field_conf_scheme.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_cust_field_conf_cmf_cust_field_conf_scheme_left_id'), 'cmf_cust_field_conf_cmf_cust_field_conf_scheme', ['left_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_cmf_cust_field_conf_scheme_parent_id'), 'cmf_cust_field_conf_cmf_cust_field_conf_scheme', ['parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_cmf_cust_field_conf_scheme_right_id'), 'cmf_cust_field_conf_cmf_cust_field_conf_scheme', ['right_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_cmf_cust_field_conf_scheme_root_id'), 'cmf_cust_field_conf_cmf_cust_field_conf_scheme', ['root_id'], unique=False)
    op.create_table('cmf_cust_field_conf_cmf_project',
    sa.Column('id', sa.String(length=128), nullable=False),
    sa.Column('parent_id', sa.String(length=64), nullable=True),
    sa.Column('root_id', sa.String(length=64), nullable=True),
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('left_id', sa.String(length=64), nullable=True),
    sa.Column('right_id', sa.String(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.ForeignKeyConstraint(['left_id'], ['cmf_cust_field_conf.id'], ),
    sa.ForeignKeyConstraint(['right_id'], ['cmf_project.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_cust_field_conf_cmf_project_left_id'), 'cmf_cust_field_conf_cmf_project', ['left_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_cmf_project_parent_id'), 'cmf_cust_field_conf_cmf_project', ['parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_cmf_project_right_id'), 'cmf_cust_field_conf_cmf_project', ['right_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_cmf_project_root_id'), 'cmf_cust_field_conf_cmf_project', ['root_id'], unique=False)
    op.create_table('cmf_cust_field_conf_field',
    sa.Column('id', sa.String(length=64), nullable=False),
    sa.Column('cmf_locked_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_created_at', sa.TIMESTAMP(timezone=True), nullable=False),
    sa.Column('cmf_modified_at', sa.TIMESTAMP(timezone=True), nullable=False),
    sa.Column('cmf_viewed_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_deleted', sa.Boolean(), nullable=False),
    sa.Column('cmf_version', sa.BIGINT(), nullable=True),
    sa.Column('name', sa.String(length=256), nullable=True),
    sa.Column('code', sa.String(length=64), nullable=True),
    sa.Column('system', sa.Boolean(), nullable=False),
    sa.Column('text', sa.TEXT(), nullable=True),
    sa.Column('import_original', sa.Boolean(), nullable=True),
    sa.Column('import_raw_json', sa.TEXT(), nullable=True),
    sa.Column('ext_id', sa.String(), nullable=True),
    sa.Column('cmf_archived', sa.Boolean(), nullable=False),
    sa.Column('is_favorite', sa.Boolean(), nullable=True),
    sa.Column('has_tree_nodes', sa.Boolean(), nullable=True),
    sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True),
    sa.Column('tree_hidden', sa.Boolean(), nullable=True),
    sa.Column('orderno', sa.Integer(), nullable=True),
    sa.Column('perm_public', sa.Boolean(), nullable=True),
    sa.Column('perm_has_acl', sa.Boolean(), nullable=True),
    sa.Column('perm_inherit', sa.Boolean(), nullable=True),
    sa.Column('perm_parent_owner_id', sa.String(length=64), nullable=True),
    sa.Column('perm_inherit_acl_id', sa.String(length=64), nullable=True),
    sa.Column('perm_effective_acl_id', sa.String(length=64), nullable=True),
    sa.Column('perm_security_level_allowed_ids_cache', sa.TEXT(), nullable=True),
    sa.Column('perm_encrypt', sa.Boolean(), nullable=True),
    sa.Column('orig_caption', sa.String(), nullable=True),
    sa.Column('caption', sa.String(), nullable=True),
    sa.Column('choices', sa.TEXT(), nullable=True),
    sa.Column('placeholder', sa.String(), nullable=True),
    sa.Column('comment', sa.String(), nullable=True),
    sa.Column('default', sa.String(), nullable=True),
    sa.Column('visible', sa.Boolean(), nullable=True),
    sa.Column('field_readonly', sa.Boolean(), nullable=True),
    sa.Column('required', sa.Boolean(), nullable=True),
    sa.Column('disabled_choices', sa.TEXT(), nullable=True),
    sa.Column('cmf_author_id', sa.String(length=64), nullable=True),
    sa.Column('cmf_owner_id', sa.String(length=64), nullable=True),
    sa.Column('parent_id', sa.String(length=64), nullable=False),
    sa.Column('cmf_modified_by_id', sa.String(length=64), nullable=True),
    sa.Column('cmf_locked_by_id', sa.String(length=64), nullable=True),
    sa.Column('cmf_import_id', sa.String(length=64), nullable=True),
    sa.Column('tree_parent_id', sa.String(length=64), nullable=True),
    sa.Column('root_parent_id', sa.String(length=64), nullable=True),
    sa.Column('project_id', sa.String(length=64), nullable=True),
    sa.Column('perm_acl_id', sa.String(length=64), nullable=True),
    sa.Column('perm_parent_id', sa.String(length=64), nullable=True),
    sa.Column('cust_field_id', sa.String(length=64), nullable=True),
    sa.ForeignKeyConstraint(['cmf_import_id'], ['cmf_import.id'], ),
    sa.ForeignKeyConstraint(['cust_field_id'], ['cmf_cust_field.id'], ),
    sa.ForeignKeyConstraint(['parent_id'], ['cmf_cust_field_conf.id'], ),
    sa.ForeignKeyConstraint(['perm_acl_id'], ['cmf_access_list.id'], ),
    sa.ForeignKeyConstraint(['project_id'], ['cmf_project.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_cust_field_conf_field_cmf_author_id'), 'cmf_cust_field_conf_field', ['cmf_author_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_field_cmf_created_at'), 'cmf_cust_field_conf_field', ['cmf_created_at'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_field_cmf_deleted'), 'cmf_cust_field_conf_field', ['cmf_deleted'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_field_cmf_import_id'), 'cmf_cust_field_conf_field', ['cmf_import_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_field_cmf_locked_at'), 'cmf_cust_field_conf_field', ['cmf_locked_at'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_field_cmf_locked_by_id'), 'cmf_cust_field_conf_field', ['cmf_locked_by_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_field_cmf_modified_at'), 'cmf_cust_field_conf_field', ['cmf_modified_at'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_field_cmf_modified_by_id'), 'cmf_cust_field_conf_field', ['cmf_modified_by_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_field_cmf_owner_id'), 'cmf_cust_field_conf_field', ['cmf_owner_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_field_cmf_version'), 'cmf_cust_field_conf_field', ['cmf_version'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_field_cmf_viewed_at'), 'cmf_cust_field_conf_field', ['cmf_viewed_at'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_field_code'), 'cmf_cust_field_conf_field', ['code'], unique=True)
    op.create_index(op.f('ix_cmf_cust_field_conf_field_cust_field_id'), 'cmf_cust_field_conf_field', ['cust_field_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_field_name'), 'cmf_cust_field_conf_field', ['name'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_field_orderno'), 'cmf_cust_field_conf_field', ['orderno'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_field_parent_id'), 'cmf_cust_field_conf_field', ['parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_field_perm_acl_id'), 'cmf_cust_field_conf_field', ['perm_acl_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_field_perm_parent_id'), 'cmf_cust_field_conf_field', ['perm_parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_field_project_id'), 'cmf_cust_field_conf_field', ['project_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_field_root_parent_id'), 'cmf_cust_field_conf_field', ['root_parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_field_tree_parent_id'), 'cmf_cust_field_conf_field', ['tree_parent_id'], unique=False)

    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_cmf_author_id'), 'cmf_cust_field_conf_scheme', ['cmf_author_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_cmf_created_at'), 'cmf_cust_field_conf_scheme', ['cmf_created_at'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_cmf_deleted'), 'cmf_cust_field_conf_scheme', ['cmf_deleted'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_cmf_import_id'), 'cmf_cust_field_conf_scheme', ['cmf_import_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_cmf_locked_at'), 'cmf_cust_field_conf_scheme', ['cmf_locked_at'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_cmf_locked_by_id'), 'cmf_cust_field_conf_scheme', ['cmf_locked_by_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_cmf_modified_at'), 'cmf_cust_field_conf_scheme', ['cmf_modified_at'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_cmf_modified_by_id'), 'cmf_cust_field_conf_scheme', ['cmf_modified_by_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_cmf_owner_id'), 'cmf_cust_field_conf_scheme', ['cmf_owner_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_cmf_version'), 'cmf_cust_field_conf_scheme', ['cmf_version'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_cmf_viewed_at'), 'cmf_cust_field_conf_scheme', ['cmf_viewed_at'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_code'), 'cmf_cust_field_conf_scheme', ['code'], unique=True)
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_name'), 'cmf_cust_field_conf_scheme', ['name'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_orderno'), 'cmf_cust_field_conf_scheme', ['orderno'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_parent_id'), 'cmf_cust_field_conf_scheme', ['parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_perm_acl_id'), 'cmf_cust_field_conf_scheme', ['perm_acl_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_perm_parent_id'), 'cmf_cust_field_conf_scheme', ['perm_parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_project_id'), 'cmf_cust_field_conf_scheme', ['project_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_root_parent_id'), 'cmf_cust_field_conf_scheme', ['root_parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_tree_parent_id'), 'cmf_cust_field_conf_scheme', ['tree_parent_id'], unique=False)
    op.create_table('cmf_cust_field_conf_scheme_rule',
    sa.Column('id', sa.String(length=64), nullable=False),
    sa.Column('cmf_locked_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_created_at', sa.TIMESTAMP(timezone=True), nullable=False),
    sa.Column('cmf_modified_at', sa.TIMESTAMP(timezone=True), nullable=False),
    sa.Column('cmf_viewed_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_deleted', sa.Boolean(), nullable=False),
    sa.Column('cmf_version', sa.BIGINT(), nullable=True),
    sa.Column('name', sa.String(length=256), nullable=True),
    sa.Column('code', sa.String(length=64), nullable=True),
    sa.Column('system', sa.Boolean(), nullable=False),
    sa.Column('text', sa.TEXT(), nullable=True),
    sa.Column('import_original', sa.Boolean(), nullable=True),
    sa.Column('import_raw_json', sa.TEXT(), nullable=True),
    sa.Column('ext_id', sa.String(), nullable=True),
    sa.Column('cmf_archived', sa.Boolean(), nullable=False),
    sa.Column('is_favorite', sa.Boolean(), nullable=True),
    sa.Column('has_tree_nodes', sa.Boolean(), nullable=True),
    sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True),
    sa.Column('tree_hidden', sa.Boolean(), nullable=True),
    sa.Column('orderno', sa.Integer(), nullable=True),
    sa.Column('perm_public', sa.Boolean(), nullable=True),
    sa.Column('perm_has_acl', sa.Boolean(), nullable=True),
    sa.Column('perm_inherit', sa.Boolean(), nullable=True),
    sa.Column('perm_parent_owner_id', sa.String(length=64), nullable=True),
    sa.Column('perm_inherit_acl_id', sa.String(length=64), nullable=True),
    sa.Column('perm_effective_acl_id', sa.String(length=64), nullable=True),
    sa.Column('perm_security_level_allowed_ids_cache', sa.TEXT(), nullable=True),
    sa.Column('perm_encrypt', sa.Boolean(), nullable=True),
    sa.Column('parent_logic_prefix', sa.TEXT(), nullable=True),
    sa.Column('cmf_author_id', sa.String(length=64), nullable=True),
    sa.Column('cmf_owner_id', sa.String(length=64), nullable=True),
    sa.Column('parent_id', sa.String(length=64), nullable=True),
    sa.Column('cmf_modified_by_id', sa.String(length=64), nullable=True),
    sa.Column('cmf_locked_by_id', sa.String(length=64), nullable=True),
    sa.Column('cmf_import_id', sa.String(length=64), nullable=True),
    sa.Column('tree_parent_id', sa.String(length=64), nullable=True),
    sa.Column('root_parent_id', sa.String(length=64), nullable=True),
    sa.Column('project_id', sa.String(length=64), nullable=True),
    sa.Column('perm_acl_id', sa.String(length=64), nullable=True),
    sa.Column('perm_parent_id', sa.String(length=64), nullable=True),
    sa.Column('cust_field_conf_id', sa.String(length=64), nullable=True),
    sa.ForeignKeyConstraint(['cmf_import_id'], ['cmf_import.id'], ),
    sa.ForeignKeyConstraint(['cust_field_conf_id'], ['cmf_cust_field_conf.id'], ),
    sa.ForeignKeyConstraint(['parent_id'], ['cmf_cust_field_conf_scheme.id'], ),
    sa.ForeignKeyConstraint(['perm_acl_id'], ['cmf_access_list.id'], ),
    sa.ForeignKeyConstraint(['project_id'], ['cmf_project.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_rule_cmf_author_id'), 'cmf_cust_field_conf_scheme_rule', ['cmf_author_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_rule_cmf_created_at'), 'cmf_cust_field_conf_scheme_rule', ['cmf_created_at'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_rule_cmf_deleted'), 'cmf_cust_field_conf_scheme_rule', ['cmf_deleted'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_rule_cmf_import_id'), 'cmf_cust_field_conf_scheme_rule', ['cmf_import_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_rule_cmf_locked_at'), 'cmf_cust_field_conf_scheme_rule', ['cmf_locked_at'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_rule_cmf_locked_by_id'), 'cmf_cust_field_conf_scheme_rule', ['cmf_locked_by_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_rule_cmf_modified_at'), 'cmf_cust_field_conf_scheme_rule', ['cmf_modified_at'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_rule_cmf_modified_by_id'), 'cmf_cust_field_conf_scheme_rule', ['cmf_modified_by_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_rule_cmf_owner_id'), 'cmf_cust_field_conf_scheme_rule', ['cmf_owner_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_rule_cmf_version'), 'cmf_cust_field_conf_scheme_rule', ['cmf_version'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_rule_cmf_viewed_at'), 'cmf_cust_field_conf_scheme_rule', ['cmf_viewed_at'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_rule_code'), 'cmf_cust_field_conf_scheme_rule', ['code'], unique=True)
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_rule_cust_field_conf_id'), 'cmf_cust_field_conf_scheme_rule', ['cust_field_conf_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_rule_name'), 'cmf_cust_field_conf_scheme_rule', ['name'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_rule_orderno'), 'cmf_cust_field_conf_scheme_rule', ['orderno'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_rule_parent_id'), 'cmf_cust_field_conf_scheme_rule', ['parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_rule_perm_acl_id'), 'cmf_cust_field_conf_scheme_rule', ['perm_acl_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_rule_perm_parent_id'), 'cmf_cust_field_conf_scheme_rule', ['perm_parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_rule_project_id'), 'cmf_cust_field_conf_scheme_rule', ['project_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_rule_root_parent_id'), 'cmf_cust_field_conf_scheme_rule', ['root_parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_rule_tree_parent_id'), 'cmf_cust_field_conf_scheme_rule', ['tree_parent_id'], unique=False)
    op.create_table('cmf_cust_field_conf_scheme_rule_cmf_activity',
    sa.Column('id', sa.String(length=128), nullable=False),
    sa.Column('parent_id', sa.String(length=64), nullable=True),
    sa.Column('root_id', sa.String(length=64), nullable=True),
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('left_id', sa.String(length=64), nullable=True),
    sa.Column('right_id', sa.String(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.ForeignKeyConstraint(['left_id'], ['cmf_cust_field_conf_scheme_rule.id'], ),
    sa.ForeignKeyConstraint(['right_id'], ['cmf_activity.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_rule_cmf_activity_left_id'), 'cmf_cust_field_conf_scheme_rule_cmf_activity', ['left_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_rule_cmf_activity_parent_id'), 'cmf_cust_field_conf_scheme_rule_cmf_activity', ['parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_rule_cmf_activity_right_id'), 'cmf_cust_field_conf_scheme_rule_cmf_activity', ['right_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_rule_cmf_activity_root_id'), 'cmf_cust_field_conf_scheme_rule_cmf_activity', ['root_id'], unique=False)
    op.create_table('cmf_cust_field_conf_scheme_rule_cmf_logic_type',
    sa.Column('id', sa.String(length=128), nullable=False),
    sa.Column('parent_id', sa.String(length=64), nullable=True),
    sa.Column('root_id', sa.String(length=64), nullable=True),
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('left_id', sa.String(length=64), nullable=True),
    sa.Column('right_id', sa.String(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.ForeignKeyConstraint(['left_id'], ['cmf_cust_field_conf_scheme_rule.id'], ),
    sa.ForeignKeyConstraint(['right_id'], ['cmf_logic_type.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_rule_cmf_logic_type_left_id'), 'cmf_cust_field_conf_scheme_rule_cmf_logic_type', ['left_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_rule_cmf_logic_type_parent_id'), 'cmf_cust_field_conf_scheme_rule_cmf_logic_type', ['parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_rule_cmf_logic_type_right_id'), 'cmf_cust_field_conf_scheme_rule_cmf_logic_type', ['right_id'], unique=False)
    op.create_index(op.f('ix_cmf_cust_field_conf_scheme_rule_cmf_logic_type_root_id'), 'cmf_cust_field_conf_scheme_rule_cmf_logic_type', ['root_id'], unique=False)
    op.create_table('cmf_ui_form_field',
    sa.Column('id', sa.String(length=64), nullable=False),
    sa.Column('cmf_locked_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_created_at', sa.TIMESTAMP(timezone=True), nullable=False),
    sa.Column('cmf_modified_at', sa.TIMESTAMP(timezone=True), nullable=False),
    sa.Column('cmf_viewed_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_deleted', sa.Boolean(), nullable=False),
    sa.Column('cmf_version', sa.BIGINT(), nullable=True),
    sa.Column('name', sa.String(length=256), nullable=False),
    sa.Column('code', sa.String(length=64), nullable=True),
    sa.Column('system', sa.Boolean(), nullable=False),
    sa.Column('text', sa.TEXT(), nullable=True),
    sa.Column('import_original', sa.Boolean(), nullable=True),
    sa.Column('import_raw_json', sa.TEXT(), nullable=True),
    sa.Column('ext_id', sa.String(), nullable=True),
    sa.Column('cmf_archived', sa.Boolean(), nullable=False),
    sa.Column('is_favorite', sa.Boolean(), nullable=True),
    sa.Column('has_tree_nodes', sa.Boolean(), nullable=True),
    sa.Column('tree_node_is_branch', sa.Boolean(), nullable=True),
    sa.Column('tree_hidden', sa.Boolean(), nullable=True),
    sa.Column('orderno', sa.Integer(), nullable=True),
    sa.Column('perm_public', sa.Boolean(), nullable=True),
    sa.Column('perm_has_acl', sa.Boolean(), nullable=True),
    sa.Column('perm_inherit', sa.Boolean(), nullable=True),
    sa.Column('perm_parent_owner_id', sa.String(length=64), nullable=True),
    sa.Column('perm_inherit_acl_id', sa.String(length=64), nullable=True),
    sa.Column('perm_effective_acl_id', sa.String(length=64), nullable=True),
    sa.Column('perm_security_level_allowed_ids_cache', sa.TEXT(), nullable=True),
    sa.Column('perm_encrypt', sa.Boolean(), nullable=True),
    sa.Column('type', sa.String(length=32), nullable=False),
    sa.Column('params', sa.TEXT(), nullable=False),
    sa.Column('required_change', sa.Boolean(), nullable=False),
    sa.Column('hidden', sa.Boolean(), nullable=False),
    sa.Column('cmf_author_id', sa.String(length=64), nullable=True),
    sa.Column('cmf_owner_id', sa.String(length=64), nullable=True),
    sa.Column('parent_id', sa.String(length=64), nullable=True),
    sa.Column('cmf_modified_by_id', sa.String(length=64), nullable=True),
    sa.Column('cmf_locked_by_id', sa.String(length=64), nullable=True),
    sa.Column('cmf_import_id', sa.String(length=64), nullable=True),
    sa.Column('tree_parent_id', sa.String(length=64), nullable=True),
    sa.Column('root_parent_id', sa.String(length=64), nullable=True),
    sa.Column('project_id', sa.String(length=64), nullable=True),
    sa.Column('perm_acl_id', sa.String(length=64), nullable=True),
    sa.Column('perm_parent_id', sa.String(length=64), nullable=True),
    sa.Column('ui_form_group_id', sa.String(length=64), nullable=True),
    sa.Column('cust_field_id', sa.String(length=64), nullable=True),
    sa.ForeignKeyConstraint(['cmf_import_id'], ['cmf_import.id'], ),
    sa.ForeignKeyConstraint(['cust_field_id'], ['cmf_cust_field.id'], ),
    sa.ForeignKeyConstraint(['parent_id'], ['cmf_ui_form.id'], ),
    sa.ForeignKeyConstraint(['perm_acl_id'], ['cmf_access_list.id'], ),
    sa.ForeignKeyConstraint(['project_id'], ['cmf_project.id'], ),
    sa.ForeignKeyConstraint(['ui_form_group_id'], ['cmf_ui_form_group.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_ui_form_field_cmf_author_id'), 'cmf_ui_form_field', ['cmf_author_id'], unique=False)
    op.create_index(op.f('ix_cmf_ui_form_field_cmf_created_at'), 'cmf_ui_form_field', ['cmf_created_at'], unique=False)
    op.create_index(op.f('ix_cmf_ui_form_field_cmf_deleted'), 'cmf_ui_form_field', ['cmf_deleted'], unique=False)
    op.create_index(op.f('ix_cmf_ui_form_field_cmf_import_id'), 'cmf_ui_form_field', ['cmf_import_id'], unique=False)
    op.create_index(op.f('ix_cmf_ui_form_field_cmf_locked_at'), 'cmf_ui_form_field', ['cmf_locked_at'], unique=False)
    op.create_index(op.f('ix_cmf_ui_form_field_cmf_locked_by_id'), 'cmf_ui_form_field', ['cmf_locked_by_id'], unique=False)
    op.create_index(op.f('ix_cmf_ui_form_field_cmf_modified_at'), 'cmf_ui_form_field', ['cmf_modified_at'], unique=False)
    op.create_index(op.f('ix_cmf_ui_form_field_cmf_modified_by_id'), 'cmf_ui_form_field', ['cmf_modified_by_id'], unique=False)
    op.create_index(op.f('ix_cmf_ui_form_field_cmf_owner_id'), 'cmf_ui_form_field', ['cmf_owner_id'], unique=False)
    op.create_index(op.f('ix_cmf_ui_form_field_cmf_version'), 'cmf_ui_form_field', ['cmf_version'], unique=False)
    op.create_index(op.f('ix_cmf_ui_form_field_cmf_viewed_at'), 'cmf_ui_form_field', ['cmf_viewed_at'], unique=False)
    op.create_index(op.f('ix_cmf_ui_form_field_code'), 'cmf_ui_form_field', ['code'], unique=True)
    op.create_index(op.f('ix_cmf_ui_form_field_cust_field_id'), 'cmf_ui_form_field', ['cust_field_id'], unique=False)
    op.create_index(op.f('ix_cmf_ui_form_field_name'), 'cmf_ui_form_field', ['name'], unique=False)
    op.create_index(op.f('ix_cmf_ui_form_field_orderno'), 'cmf_ui_form_field', ['orderno'], unique=False)
    op.create_index(op.f('ix_cmf_ui_form_field_parent_id'), 'cmf_ui_form_field', ['parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_ui_form_field_perm_acl_id'), 'cmf_ui_form_field', ['perm_acl_id'], unique=False)
    op.create_index(op.f('ix_cmf_ui_form_field_perm_parent_id'), 'cmf_ui_form_field', ['perm_parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_ui_form_field_project_id'), 'cmf_ui_form_field', ['project_id'], unique=False)
    op.create_index(op.f('ix_cmf_ui_form_field_root_parent_id'), 'cmf_ui_form_field', ['root_parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_ui_form_field_tree_parent_id'), 'cmf_ui_form_field', ['tree_parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_ui_form_field_ui_form_group_id'), 'cmf_ui_form_field', ['ui_form_group_id'], unique=False)
    
    op.create_index(op.f('ix_cmf_ui_form_group_cmf_author_id'), 'cmf_ui_form_group', ['cmf_author_id'], unique=False)
    op.create_index(op.f('ix_cmf_ui_form_group_cmf_created_at'), 'cmf_ui_form_group', ['cmf_created_at'], unique=False)
    op.create_index(op.f('ix_cmf_ui_form_group_cmf_deleted'), 'cmf_ui_form_group', ['cmf_deleted'], unique=False)
    op.create_index(op.f('ix_cmf_ui_form_group_cmf_import_id'), 'cmf_ui_form_group', ['cmf_import_id'], unique=False)
    op.create_index(op.f('ix_cmf_ui_form_group_cmf_locked_at'), 'cmf_ui_form_group', ['cmf_locked_at'], unique=False)
    op.create_index(op.f('ix_cmf_ui_form_group_cmf_locked_by_id'), 'cmf_ui_form_group', ['cmf_locked_by_id'], unique=False)
    op.create_index(op.f('ix_cmf_ui_form_group_cmf_modified_at'), 'cmf_ui_form_group', ['cmf_modified_at'], unique=False)
    op.create_index(op.f('ix_cmf_ui_form_group_cmf_modified_by_id'), 'cmf_ui_form_group', ['cmf_modified_by_id'], unique=False)
    op.create_index(op.f('ix_cmf_ui_form_group_cmf_owner_id'), 'cmf_ui_form_group', ['cmf_owner_id'], unique=False)
    op.create_index(op.f('ix_cmf_ui_form_group_cmf_version'), 'cmf_ui_form_group', ['cmf_version'], unique=False)
    op.create_index(op.f('ix_cmf_ui_form_group_cmf_viewed_at'), 'cmf_ui_form_group', ['cmf_viewed_at'], unique=False)
    op.create_index(op.f('ix_cmf_ui_form_group_code'), 'cmf_ui_form_group', ['code'], unique=True)
    op.create_index(op.f('ix_cmf_ui_form_group_name'), 'cmf_ui_form_group', ['name'], unique=False)
    op.create_index(op.f('ix_cmf_ui_form_group_orderno'), 'cmf_ui_form_group', ['orderno'], unique=False)
    op.create_index(op.f('ix_cmf_ui_form_group_parent_id'), 'cmf_ui_form_group', ['parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_ui_form_group_perm_acl_id'), 'cmf_ui_form_group', ['perm_acl_id'], unique=False)
    op.create_index(op.f('ix_cmf_ui_form_group_perm_parent_id'), 'cmf_ui_form_group', ['perm_parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_ui_form_group_project_id'), 'cmf_ui_form_group', ['project_id'], unique=False)
    op.create_index(op.f('ix_cmf_ui_form_group_root_parent_id'), 'cmf_ui_form_group', ['root_parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_ui_form_group_tree_parent_id'), 'cmf_ui_form_group', ['tree_parent_id'], unique=False)
    op.alter_column('cmf_global_settings', 'closed_contour',
               existing_type=sa.BOOLEAN(),
               nullable=True,
               existing_server_default=sa.text('false'))
    op.alter_column('cmf_global_settings', 'default_show_mydocs',
               existing_type=sa.BOOLEAN(),
               nullable=False,
               existing_server_default=sa.text('true'))
    op.alter_column('cmf_global_settings', 'default_show_mail',
               existing_type=sa.BOOLEAN(),
               nullable=False,
               existing_server_default=sa.text('true'))
    op.add_column('cmf_project', sa.Column('cust_field_conf_scheme_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_project_cust_field_conf_scheme_id'), 'cmf_project', ['cust_field_conf_scheme_id'], unique=False)
    op.create_foreign_key(None, 'cmf_project', 'cmf_cust_field_conf_scheme', ['cust_field_conf_scheme_id'], ['id'])
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'cmf_project', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_project_cust_field_conf_scheme_id'), table_name='cmf_project')
    op.drop_column('cmf_project', 'cust_field_conf_scheme_id')
    op.alter_column('cmf_global_settings', 'default_show_mail',
               existing_type=sa.BOOLEAN(),
               nullable=True,
               existing_server_default=sa.text('true'))
    op.alter_column('cmf_global_settings', 'default_show_mydocs',
               existing_type=sa.BOOLEAN(),
               nullable=True,
               existing_server_default=sa.text('true'))
    op.alter_column('cmf_global_settings', 'closed_contour',
               existing_type=sa.BOOLEAN(),
               nullable=False,
               existing_server_default=sa.text('false'))
    op.drop_index(op.f('ix_cmf_ui_form_group_tree_parent_id'), table_name='cmf_ui_form_group')
    op.drop_index(op.f('ix_cmf_ui_form_group_root_parent_id'), table_name='cmf_ui_form_group')
    op.drop_index(op.f('ix_cmf_ui_form_group_project_id'), table_name='cmf_ui_form_group')
    op.drop_index(op.f('ix_cmf_ui_form_group_perm_parent_id'), table_name='cmf_ui_form_group')
    op.drop_index(op.f('ix_cmf_ui_form_group_perm_acl_id'), table_name='cmf_ui_form_group')
    op.drop_index(op.f('ix_cmf_ui_form_group_parent_id'), table_name='cmf_ui_form_group')
    op.drop_index(op.f('ix_cmf_ui_form_group_orderno'), table_name='cmf_ui_form_group')
    op.drop_index(op.f('ix_cmf_ui_form_group_name'), table_name='cmf_ui_form_group')
    op.drop_index(op.f('ix_cmf_ui_form_group_code'), table_name='cmf_ui_form_group')
    op.drop_index(op.f('ix_cmf_ui_form_group_cmf_viewed_at'), table_name='cmf_ui_form_group')
    op.drop_index(op.f('ix_cmf_ui_form_group_cmf_version'), table_name='cmf_ui_form_group')
    op.drop_index(op.f('ix_cmf_ui_form_group_cmf_owner_id'), table_name='cmf_ui_form_group')
    op.drop_index(op.f('ix_cmf_ui_form_group_cmf_modified_by_id'), table_name='cmf_ui_form_group')
    op.drop_index(op.f('ix_cmf_ui_form_group_cmf_modified_at'), table_name='cmf_ui_form_group')
    op.drop_index(op.f('ix_cmf_ui_form_group_cmf_locked_by_id'), table_name='cmf_ui_form_group')
    op.drop_index(op.f('ix_cmf_ui_form_group_cmf_locked_at'), table_name='cmf_ui_form_group')
    op.drop_index(op.f('ix_cmf_ui_form_group_cmf_import_id'), table_name='cmf_ui_form_group')
    op.drop_index(op.f('ix_cmf_ui_form_group_cmf_deleted'), table_name='cmf_ui_form_group')
    op.drop_index(op.f('ix_cmf_ui_form_group_cmf_created_at'), table_name='cmf_ui_form_group')
    op.drop_index(op.f('ix_cmf_ui_form_group_cmf_author_id'), table_name='cmf_ui_form_group')
    op.drop_table('cmf_ui_form_group')
    op.drop_index(op.f('ix_cmf_ui_form_field_ui_form_group_id'), table_name='cmf_ui_form_field')
    op.drop_index(op.f('ix_cmf_ui_form_field_tree_parent_id'), table_name='cmf_ui_form_field')
    op.drop_index(op.f('ix_cmf_ui_form_field_root_parent_id'), table_name='cmf_ui_form_field')
    op.drop_index(op.f('ix_cmf_ui_form_field_project_id'), table_name='cmf_ui_form_field')
    op.drop_index(op.f('ix_cmf_ui_form_field_perm_parent_id'), table_name='cmf_ui_form_field')
    op.drop_index(op.f('ix_cmf_ui_form_field_perm_acl_id'), table_name='cmf_ui_form_field')
    op.drop_index(op.f('ix_cmf_ui_form_field_parent_id'), table_name='cmf_ui_form_field')
    op.drop_index(op.f('ix_cmf_ui_form_field_orderno'), table_name='cmf_ui_form_field')
    op.drop_index(op.f('ix_cmf_ui_form_field_name'), table_name='cmf_ui_form_field')
    op.drop_index(op.f('ix_cmf_ui_form_field_cust_field_id'), table_name='cmf_ui_form_field')
    op.drop_index(op.f('ix_cmf_ui_form_field_code'), table_name='cmf_ui_form_field')
    op.drop_index(op.f('ix_cmf_ui_form_field_cmf_viewed_at'), table_name='cmf_ui_form_field')
    op.drop_index(op.f('ix_cmf_ui_form_field_cmf_version'), table_name='cmf_ui_form_field')
    op.drop_index(op.f('ix_cmf_ui_form_field_cmf_owner_id'), table_name='cmf_ui_form_field')
    op.drop_index(op.f('ix_cmf_ui_form_field_cmf_modified_by_id'), table_name='cmf_ui_form_field')
    op.drop_index(op.f('ix_cmf_ui_form_field_cmf_modified_at'), table_name='cmf_ui_form_field')
    op.drop_index(op.f('ix_cmf_ui_form_field_cmf_locked_by_id'), table_name='cmf_ui_form_field')
    op.drop_index(op.f('ix_cmf_ui_form_field_cmf_locked_at'), table_name='cmf_ui_form_field')
    op.drop_index(op.f('ix_cmf_ui_form_field_cmf_import_id'), table_name='cmf_ui_form_field')
    op.drop_index(op.f('ix_cmf_ui_form_field_cmf_deleted'), table_name='cmf_ui_form_field')
    op.drop_index(op.f('ix_cmf_ui_form_field_cmf_created_at'), table_name='cmf_ui_form_field')
    op.drop_index(op.f('ix_cmf_ui_form_field_cmf_author_id'), table_name='cmf_ui_form_field')
    op.drop_table('cmf_ui_form_field')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_rule_cmf_logic_type_root_id'), table_name='cmf_cust_field_conf_scheme_rule_cmf_logic_type')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_rule_cmf_logic_type_right_id'), table_name='cmf_cust_field_conf_scheme_rule_cmf_logic_type')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_rule_cmf_logic_type_parent_id'), table_name='cmf_cust_field_conf_scheme_rule_cmf_logic_type')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_rule_cmf_logic_type_left_id'), table_name='cmf_cust_field_conf_scheme_rule_cmf_logic_type')
    op.drop_table('cmf_cust_field_conf_scheme_rule_cmf_logic_type')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_rule_cmf_activity_root_id'), table_name='cmf_cust_field_conf_scheme_rule_cmf_activity')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_rule_cmf_activity_right_id'), table_name='cmf_cust_field_conf_scheme_rule_cmf_activity')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_rule_cmf_activity_parent_id'), table_name='cmf_cust_field_conf_scheme_rule_cmf_activity')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_rule_cmf_activity_left_id'), table_name='cmf_cust_field_conf_scheme_rule_cmf_activity')
    op.drop_table('cmf_cust_field_conf_scheme_rule_cmf_activity')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_rule_tree_parent_id'), table_name='cmf_cust_field_conf_scheme_rule')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_rule_root_parent_id'), table_name='cmf_cust_field_conf_scheme_rule')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_rule_project_id'), table_name='cmf_cust_field_conf_scheme_rule')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_rule_perm_parent_id'), table_name='cmf_cust_field_conf_scheme_rule')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_rule_perm_acl_id'), table_name='cmf_cust_field_conf_scheme_rule')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_rule_parent_id'), table_name='cmf_cust_field_conf_scheme_rule')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_rule_orderno'), table_name='cmf_cust_field_conf_scheme_rule')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_rule_name'), table_name='cmf_cust_field_conf_scheme_rule')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_rule_cust_field_conf_id'), table_name='cmf_cust_field_conf_scheme_rule')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_rule_code'), table_name='cmf_cust_field_conf_scheme_rule')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_rule_cmf_viewed_at'), table_name='cmf_cust_field_conf_scheme_rule')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_rule_cmf_version'), table_name='cmf_cust_field_conf_scheme_rule')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_rule_cmf_owner_id'), table_name='cmf_cust_field_conf_scheme_rule')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_rule_cmf_modified_by_id'), table_name='cmf_cust_field_conf_scheme_rule')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_rule_cmf_modified_at'), table_name='cmf_cust_field_conf_scheme_rule')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_rule_cmf_locked_by_id'), table_name='cmf_cust_field_conf_scheme_rule')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_rule_cmf_locked_at'), table_name='cmf_cust_field_conf_scheme_rule')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_rule_cmf_import_id'), table_name='cmf_cust_field_conf_scheme_rule')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_rule_cmf_deleted'), table_name='cmf_cust_field_conf_scheme_rule')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_rule_cmf_created_at'), table_name='cmf_cust_field_conf_scheme_rule')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_rule_cmf_author_id'), table_name='cmf_cust_field_conf_scheme_rule')
    op.drop_table('cmf_cust_field_conf_scheme_rule')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_tree_parent_id'), table_name='cmf_cust_field_conf_scheme')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_root_parent_id'), table_name='cmf_cust_field_conf_scheme')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_project_id'), table_name='cmf_cust_field_conf_scheme')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_perm_parent_id'), table_name='cmf_cust_field_conf_scheme')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_perm_acl_id'), table_name='cmf_cust_field_conf_scheme')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_parent_id'), table_name='cmf_cust_field_conf_scheme')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_orderno'), table_name='cmf_cust_field_conf_scheme')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_name'), table_name='cmf_cust_field_conf_scheme')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_code'), table_name='cmf_cust_field_conf_scheme')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_cmf_viewed_at'), table_name='cmf_cust_field_conf_scheme')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_cmf_version'), table_name='cmf_cust_field_conf_scheme')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_cmf_owner_id'), table_name='cmf_cust_field_conf_scheme')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_cmf_modified_by_id'), table_name='cmf_cust_field_conf_scheme')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_cmf_modified_at'), table_name='cmf_cust_field_conf_scheme')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_cmf_locked_by_id'), table_name='cmf_cust_field_conf_scheme')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_cmf_locked_at'), table_name='cmf_cust_field_conf_scheme')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_cmf_import_id'), table_name='cmf_cust_field_conf_scheme')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_cmf_deleted'), table_name='cmf_cust_field_conf_scheme')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_cmf_created_at'), table_name='cmf_cust_field_conf_scheme')
    op.drop_index(op.f('ix_cmf_cust_field_conf_scheme_cmf_author_id'), table_name='cmf_cust_field_conf_scheme')
    op.drop_table('cmf_cust_field_conf_scheme')
    op.drop_index(op.f('ix_cmf_cust_field_conf_field_tree_parent_id'), table_name='cmf_cust_field_conf_field')
    op.drop_index(op.f('ix_cmf_cust_field_conf_field_root_parent_id'), table_name='cmf_cust_field_conf_field')
    op.drop_index(op.f('ix_cmf_cust_field_conf_field_project_id'), table_name='cmf_cust_field_conf_field')
    op.drop_index(op.f('ix_cmf_cust_field_conf_field_perm_parent_id'), table_name='cmf_cust_field_conf_field')
    op.drop_index(op.f('ix_cmf_cust_field_conf_field_perm_acl_id'), table_name='cmf_cust_field_conf_field')
    op.drop_index(op.f('ix_cmf_cust_field_conf_field_parent_id'), table_name='cmf_cust_field_conf_field')
    op.drop_index(op.f('ix_cmf_cust_field_conf_field_orderno'), table_name='cmf_cust_field_conf_field')
    op.drop_index(op.f('ix_cmf_cust_field_conf_field_name'), table_name='cmf_cust_field_conf_field')
    op.drop_index(op.f('ix_cmf_cust_field_conf_field_cust_field_id'), table_name='cmf_cust_field_conf_field')
    op.drop_index(op.f('ix_cmf_cust_field_conf_field_code'), table_name='cmf_cust_field_conf_field')
    op.drop_index(op.f('ix_cmf_cust_field_conf_field_cmf_viewed_at'), table_name='cmf_cust_field_conf_field')
    op.drop_index(op.f('ix_cmf_cust_field_conf_field_cmf_version'), table_name='cmf_cust_field_conf_field')
    op.drop_index(op.f('ix_cmf_cust_field_conf_field_cmf_owner_id'), table_name='cmf_cust_field_conf_field')
    op.drop_index(op.f('ix_cmf_cust_field_conf_field_cmf_modified_by_id'), table_name='cmf_cust_field_conf_field')
    op.drop_index(op.f('ix_cmf_cust_field_conf_field_cmf_modified_at'), table_name='cmf_cust_field_conf_field')
    op.drop_index(op.f('ix_cmf_cust_field_conf_field_cmf_locked_by_id'), table_name='cmf_cust_field_conf_field')
    op.drop_index(op.f('ix_cmf_cust_field_conf_field_cmf_locked_at'), table_name='cmf_cust_field_conf_field')
    op.drop_index(op.f('ix_cmf_cust_field_conf_field_cmf_import_id'), table_name='cmf_cust_field_conf_field')
    op.drop_index(op.f('ix_cmf_cust_field_conf_field_cmf_deleted'), table_name='cmf_cust_field_conf_field')
    op.drop_index(op.f('ix_cmf_cust_field_conf_field_cmf_created_at'), table_name='cmf_cust_field_conf_field')
    op.drop_index(op.f('ix_cmf_cust_field_conf_field_cmf_author_id'), table_name='cmf_cust_field_conf_field')
    op.drop_table('cmf_cust_field_conf_field')
    op.drop_index(op.f('ix_cmf_cust_field_conf_cmf_project_root_id'), table_name='cmf_cust_field_conf_cmf_project')
    op.drop_index(op.f('ix_cmf_cust_field_conf_cmf_project_right_id'), table_name='cmf_cust_field_conf_cmf_project')
    op.drop_index(op.f('ix_cmf_cust_field_conf_cmf_project_parent_id'), table_name='cmf_cust_field_conf_cmf_project')
    op.drop_index(op.f('ix_cmf_cust_field_conf_cmf_project_left_id'), table_name='cmf_cust_field_conf_cmf_project')
    op.drop_table('cmf_cust_field_conf_cmf_project')
    op.drop_index(op.f('ix_cmf_cust_field_conf_cmf_cust_field_conf_scheme_root_id'), table_name='cmf_cust_field_conf_cmf_cust_field_conf_scheme')
    op.drop_index(op.f('ix_cmf_cust_field_conf_cmf_cust_field_conf_scheme_right_id'), table_name='cmf_cust_field_conf_cmf_cust_field_conf_scheme')
    op.drop_index(op.f('ix_cmf_cust_field_conf_cmf_cust_field_conf_scheme_parent_id'), table_name='cmf_cust_field_conf_cmf_cust_field_conf_scheme')
    op.drop_index(op.f('ix_cmf_cust_field_conf_cmf_cust_field_conf_scheme_left_id'), table_name='cmf_cust_field_conf_cmf_cust_field_conf_scheme')
    op.drop_table('cmf_cust_field_conf_cmf_cust_field_conf_scheme')
    op.drop_index(op.f('ix_cmf_cust_field_conf_tree_parent_id'), table_name='cmf_cust_field_conf')
    op.drop_index(op.f('ix_cmf_cust_field_conf_root_parent_id'), table_name='cmf_cust_field_conf')
    op.drop_index(op.f('ix_cmf_cust_field_conf_project_id'), table_name='cmf_cust_field_conf')
    op.drop_index(op.f('ix_cmf_cust_field_conf_perm_parent_id'), table_name='cmf_cust_field_conf')
    op.drop_index(op.f('ix_cmf_cust_field_conf_perm_acl_id'), table_name='cmf_cust_field_conf')
    op.drop_index(op.f('ix_cmf_cust_field_conf_parent_id'), table_name='cmf_cust_field_conf')
    op.drop_index(op.f('ix_cmf_cust_field_conf_orderno'), table_name='cmf_cust_field_conf')
    op.drop_index(op.f('ix_cmf_cust_field_conf_name'), table_name='cmf_cust_field_conf')
    op.drop_index(op.f('ix_cmf_cust_field_conf_code'), table_name='cmf_cust_field_conf')
    op.drop_index(op.f('ix_cmf_cust_field_conf_cmf_viewed_at'), table_name='cmf_cust_field_conf')
    op.drop_index(op.f('ix_cmf_cust_field_conf_cmf_version'), table_name='cmf_cust_field_conf')
    op.drop_index(op.f('ix_cmf_cust_field_conf_cmf_owner_id'), table_name='cmf_cust_field_conf')
    op.drop_index(op.f('ix_cmf_cust_field_conf_cmf_modified_by_id'), table_name='cmf_cust_field_conf')
    op.drop_index(op.f('ix_cmf_cust_field_conf_cmf_modified_at'), table_name='cmf_cust_field_conf')
    op.drop_index(op.f('ix_cmf_cust_field_conf_cmf_locked_by_id'), table_name='cmf_cust_field_conf')
    op.drop_index(op.f('ix_cmf_cust_field_conf_cmf_locked_at'), table_name='cmf_cust_field_conf')
    op.drop_index(op.f('ix_cmf_cust_field_conf_cmf_import_id'), table_name='cmf_cust_field_conf')
    op.drop_index(op.f('ix_cmf_cust_field_conf_cmf_deleted'), table_name='cmf_cust_field_conf')
    op.drop_index(op.f('ix_cmf_cust_field_conf_cmf_created_at'), table_name='cmf_cust_field_conf')
    op.drop_index(op.f('ix_cmf_cust_field_conf_cmf_author_id'), table_name='cmf_cust_field_conf')
    op.drop_table('cmf_cust_field_conf')
    op.drop_index(op.f('ix_cmf_cust_field_tree_parent_id'), table_name='cmf_cust_field')
    op.drop_index(op.f('ix_cmf_cust_field_root_parent_id'), table_name='cmf_cust_field')
    op.drop_index(op.f('ix_cmf_cust_field_project_id'), table_name='cmf_cust_field')
    op.drop_index(op.f('ix_cmf_cust_field_perm_parent_id'), table_name='cmf_cust_field')
    op.drop_index(op.f('ix_cmf_cust_field_perm_acl_id'), table_name='cmf_cust_field')
    op.drop_index(op.f('ix_cmf_cust_field_parent_id'), table_name='cmf_cust_field')
    op.drop_index(op.f('ix_cmf_cust_field_orderno'), table_name='cmf_cust_field')
    op.drop_index(op.f('ix_cmf_cust_field_name'), table_name='cmf_cust_field')
    op.drop_index(op.f('ix_cmf_cust_field_code'), table_name='cmf_cust_field')
    op.drop_index(op.f('ix_cmf_cust_field_cmf_viewed_at'), table_name='cmf_cust_field')
    op.drop_index(op.f('ix_cmf_cust_field_cmf_version'), table_name='cmf_cust_field')
    op.drop_index(op.f('ix_cmf_cust_field_cmf_owner_id'), table_name='cmf_cust_field')
    op.drop_index(op.f('ix_cmf_cust_field_cmf_modified_by_id'), table_name='cmf_cust_field')
    op.drop_index(op.f('ix_cmf_cust_field_cmf_modified_at'), table_name='cmf_cust_field')
    op.drop_index(op.f('ix_cmf_cust_field_cmf_locked_by_id'), table_name='cmf_cust_field')
    op.drop_index(op.f('ix_cmf_cust_field_cmf_locked_at'), table_name='cmf_cust_field')
    op.drop_index(op.f('ix_cmf_cust_field_cmf_import_id'), table_name='cmf_cust_field')
    op.drop_index(op.f('ix_cmf_cust_field_cmf_deleted'), table_name='cmf_cust_field')
    op.drop_index(op.f('ix_cmf_cust_field_cmf_created_at'), table_name='cmf_cust_field')
    op.drop_index(op.f('ix_cmf_cust_field_cmf_author_id'), table_name='cmf_cust_field')
    op.drop_table('cmf_cust_field')
    # ### end Alembic commands ###
