"""empty message

Revision ID: 7ed56fdf83b4
Revises: 05dc7ea062aa
Create Date: 2021-01-21 11:21:29.522199

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '7ed56fdf83b4'
down_revision = '05dc7ea062aa'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('cmf_form',
    sa.Column('cmf_author_id', sa.String(length=64), nullable=True),
    sa.Column('cmf_created_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_deleted', sa.Boolean(), nullable=False),
    sa.Column('cmf_locked_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_locked_by_id', sa.String(length=64), nullable=True),
    sa.Column('cmf_modified_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_modified_by_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('id', sa.String(length=64), nullable=False),
    sa.Column('name', sa.String(length=256), nullable=True),
    sa.Column('text', sa.TEXT(), nullable=True),
    sa.Column('title', sa.String(length=64), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_form_cmf_author_id'), 'cmf_form', ['cmf_author_id'], unique=False)
    op.create_index(op.f('ix_cmf_form_cmf_created_at'), 'cmf_form', ['cmf_created_at'], unique=False)
    op.create_index(op.f('ix_cmf_form_cmf_deleted'), 'cmf_form', ['cmf_deleted'], unique=False)
    op.create_index(op.f('ix_cmf_form_cmf_locked_at'), 'cmf_form', ['cmf_locked_at'], unique=False)
    op.create_index(op.f('ix_cmf_form_cmf_locked_by_id'), 'cmf_form', ['cmf_locked_by_id'], unique=False)
    op.create_index(op.f('ix_cmf_form_cmf_modified_at'), 'cmf_form', ['cmf_modified_at'], unique=False)
    op.create_index(op.f('ix_cmf_form_cmf_modified_by_id'), 'cmf_form', ['cmf_modified_by_id'], unique=False)
    op.create_index(op.f('ix_cmf_form_cmf_owner_id'), 'cmf_form', ['cmf_owner_id'], unique=False)
    op.create_index(op.f('ix_cmf_form_cmf_version'), 'cmf_form', ['cmf_version'], unique=False)
    op.create_index(op.f('ix_cmf_form_cmf_viewed_at'), 'cmf_form', ['cmf_viewed_at'], unique=False)
    op.create_index(op.f('ix_cmf_form_code'), 'cmf_form', ['code'], unique=True)
    op.create_index(op.f('ix_cmf_form_name'), 'cmf_form', ['name'], unique=False)
    op.create_table('cmf_mail_executors',
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('id', sa.String(length=64), nullable=False),
    sa.Column('left_id', sa.String(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('parent_id', sa.String(length=64), nullable=True),
    sa.Column('right_id', sa.String(length=64), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.Column('root_id', sa.String(length=64), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_mail_executors_left_id'), 'cmf_mail_executors', ['left_id'], unique=False)
    op.create_index(op.f('ix_cmf_mail_executors_parent_id'), 'cmf_mail_executors', ['parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_mail_executors_right_id'), 'cmf_mail_executors', ['right_id'], unique=False)
    op.create_index(op.f('ix_cmf_mail_executors_root_id'), 'cmf_mail_executors', ['root_id'], unique=False)
    op.create_table('cmf_mail_related_objects',
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('id', sa.String(length=64), nullable=False),
    sa.Column('left_id', sa.String(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('parent_id', sa.String(length=64), nullable=True),
    sa.Column('right_id', sa.String(length=64), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.Column('root_id', sa.String(length=64), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_mail_related_objects_left_id'), 'cmf_mail_related_objects', ['left_id'], unique=False)
    op.create_index(op.f('ix_cmf_mail_related_objects_parent_id'), 'cmf_mail_related_objects', ['parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_mail_related_objects_right_id'), 'cmf_mail_related_objects', ['right_id'], unique=False)
    op.create_index(op.f('ix_cmf_mail_related_objects_root_id'), 'cmf_mail_related_objects', ['root_id'], unique=False)
    op.create_table('cmf_mail_spectators',
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('id', sa.String(length=64), nullable=False),
    sa.Column('left_id', sa.String(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('parent_id', sa.String(length=64), nullable=True),
    sa.Column('right_id', sa.String(length=64), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.Column('root_id', sa.String(length=64), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_mail_spectators_left_id'), 'cmf_mail_spectators', ['left_id'], unique=False)
    op.create_index(op.f('ix_cmf_mail_spectators_parent_id'), 'cmf_mail_spectators', ['parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_mail_spectators_right_id'), 'cmf_mail_spectators', ['right_id'], unique=False)
    op.create_index(op.f('ix_cmf_mail_spectators_root_id'), 'cmf_mail_spectators', ['root_id'], unique=False)
    op.create_table('cmf_mail',
    sa.Column('activity_id', sa.String(length=64), nullable=True),
    sa.Column('alarm_date', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cache_status_type', sa.String(length=32), nullable=True),
    sa.Column('cmf_author_id', sa.String(length=64), nullable=True),
    sa.Column('cmf_created_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_deleted', sa.Boolean(), nullable=False),
    sa.Column('cmf_locked_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_locked_by_id', sa.String(length=64), nullable=True),
    sa.Column('cmf_modified_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('cmf_modified_by_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('company_id', sa.String(length=64), nullable=True),
    sa.Column('deadline', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('id', sa.String(length=64), nullable=False),
    sa.Column('is_penalty', sa.Boolean(), nullable=True),
    sa.Column('mark', sa.String(length=32), nullable=True),
    sa.Column('name', sa.String(length=256), nullable=True),
    sa.Column('no_control', sa.Boolean(), nullable=True),
    sa.Column('orderno', sa.Integer(), nullable=True),
    sa.Column('parent_task_id', sa.String(length=64), nullable=True),
    sa.Column('period_clone_from_id', sa.String(length=64), nullable=True),
    sa.Column('period_interval', sa.String(length=32), nullable=True),
    sa.Column('period_next_date', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('plan_end_date', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('plan_start_date', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('priority', sa.String(length=32), nullable=False),
    sa.Column('project_id', sa.String(length=64), nullable=True),
    sa.Column('responsible_id', sa.String(length=64), nullable=True),
    sa.Column('status_id', sa.String(length=64), nullable=True),
    sa.Column('status_modified_at', sa.TIMESTAMP(timezone=True), nullable=True),
    sa.Column('tags', sa.TEXT(), nullable=True),
    sa.Column('text', sa.TEXT(), nullable=True),
    sa.Column('time_estimate', sa.Integer(), nullable=True),
    sa.Column('tree_parent_id', sa.String(length=64), nullable=True),
    sa.Column('waiting_for_id', sa.String(length=64), nullable=True),
    sa.ForeignKeyConstraint(['activity_id'], ['cmf_activity.id'], ),
    sa.ForeignKeyConstraint(['company_id'], ['cmf_company.id'], ),
    sa.ForeignKeyConstraint(['project_id'], ['cmf_project.id'], ),
    sa.ForeignKeyConstraint(['status_id'], ['cmf_status.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_mail_activity_id'), 'cmf_mail', ['activity_id'], unique=False)
    op.create_index(op.f('ix_cmf_mail_alarm_date'), 'cmf_mail', ['alarm_date'], unique=False)
    op.create_index(op.f('ix_cmf_mail_cache_status_type'), 'cmf_mail', ['cache_status_type'], unique=False)
    op.create_index(op.f('ix_cmf_mail_cmf_author_id'), 'cmf_mail', ['cmf_author_id'], unique=False)
    op.create_index(op.f('ix_cmf_mail_cmf_created_at'), 'cmf_mail', ['cmf_created_at'], unique=False)
    op.create_index(op.f('ix_cmf_mail_cmf_deleted'), 'cmf_mail', ['cmf_deleted'], unique=False)
    op.create_index(op.f('ix_cmf_mail_cmf_locked_at'), 'cmf_mail', ['cmf_locked_at'], unique=False)
    op.create_index(op.f('ix_cmf_mail_cmf_locked_by_id'), 'cmf_mail', ['cmf_locked_by_id'], unique=False)
    op.create_index(op.f('ix_cmf_mail_cmf_modified_at'), 'cmf_mail', ['cmf_modified_at'], unique=False)
    op.create_index(op.f('ix_cmf_mail_cmf_modified_by_id'), 'cmf_mail', ['cmf_modified_by_id'], unique=False)
    op.create_index(op.f('ix_cmf_mail_cmf_owner_id'), 'cmf_mail', ['cmf_owner_id'], unique=False)
    op.create_index(op.f('ix_cmf_mail_cmf_version'), 'cmf_mail', ['cmf_version'], unique=False)
    op.create_index(op.f('ix_cmf_mail_cmf_viewed_at'), 'cmf_mail', ['cmf_viewed_at'], unique=False)
    op.create_index(op.f('ix_cmf_mail_code'), 'cmf_mail', ['code'], unique=True)
    op.create_index(op.f('ix_cmf_mail_company_id'), 'cmf_mail', ['company_id'], unique=False)
    op.create_index(op.f('ix_cmf_mail_name'), 'cmf_mail', ['name'], unique=False)
    op.create_index(op.f('ix_cmf_mail_orderno'), 'cmf_mail', ['orderno'], unique=False)
    op.create_index(op.f('ix_cmf_mail_parent_task_id'), 'cmf_mail', ['parent_task_id'], unique=False)
    op.create_index(op.f('ix_cmf_mail_period_clone_from_id'), 'cmf_mail', ['period_clone_from_id'], unique=False)
    op.create_index(op.f('ix_cmf_mail_project_id'), 'cmf_mail', ['project_id'], unique=False)
    op.create_index(op.f('ix_cmf_mail_responsible_id'), 'cmf_mail', ['responsible_id'], unique=False)
    op.create_index(op.f('ix_cmf_mail_status_id'), 'cmf_mail', ['status_id'], unique=False)
    op.create_index(op.f('ix_cmf_mail_tree_parent_id'), 'cmf_mail', ['tree_parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_mail_waiting_for_id'), 'cmf_mail', ['waiting_for_id'], unique=False)
    op.create_index(op.f('ix_cmf_status_orderno'), 'cmf_status', ['orderno'], unique=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_cmf_status_orderno'), table_name='cmf_status')
    op.drop_index(op.f('ix_cmf_mail_waiting_for_id'), table_name='cmf_mail')
    op.drop_index(op.f('ix_cmf_mail_tree_parent_id'), table_name='cmf_mail')
    op.drop_index(op.f('ix_cmf_mail_status_id'), table_name='cmf_mail')
    op.drop_index(op.f('ix_cmf_mail_responsible_id'), table_name='cmf_mail')
    op.drop_index(op.f('ix_cmf_mail_project_id'), table_name='cmf_mail')
    op.drop_index(op.f('ix_cmf_mail_period_clone_from_id'), table_name='cmf_mail')
    op.drop_index(op.f('ix_cmf_mail_parent_task_id'), table_name='cmf_mail')
    op.drop_index(op.f('ix_cmf_mail_orderno'), table_name='cmf_mail')
    op.drop_index(op.f('ix_cmf_mail_name'), table_name='cmf_mail')
    op.drop_index(op.f('ix_cmf_mail_company_id'), table_name='cmf_mail')
    op.drop_index(op.f('ix_cmf_mail_code'), table_name='cmf_mail')
    op.drop_index(op.f('ix_cmf_mail_cmf_viewed_at'), table_name='cmf_mail')
    op.drop_index(op.f('ix_cmf_mail_cmf_version'), table_name='cmf_mail')
    op.drop_index(op.f('ix_cmf_mail_cmf_owner_id'), table_name='cmf_mail')
    op.drop_index(op.f('ix_cmf_mail_cmf_modified_by_id'), table_name='cmf_mail')
    op.drop_index(op.f('ix_cmf_mail_cmf_modified_at'), table_name='cmf_mail')
    op.drop_index(op.f('ix_cmf_mail_cmf_locked_by_id'), table_name='cmf_mail')
    op.drop_index(op.f('ix_cmf_mail_cmf_locked_at'), table_name='cmf_mail')
    op.drop_index(op.f('ix_cmf_mail_cmf_deleted'), table_name='cmf_mail')
    op.drop_index(op.f('ix_cmf_mail_cmf_created_at'), table_name='cmf_mail')
    op.drop_index(op.f('ix_cmf_mail_cmf_author_id'), table_name='cmf_mail')
    op.drop_index(op.f('ix_cmf_mail_cache_status_type'), table_name='cmf_mail')
    op.drop_index(op.f('ix_cmf_mail_alarm_date'), table_name='cmf_mail')
    op.drop_index(op.f('ix_cmf_mail_activity_id'), table_name='cmf_mail')
    op.drop_table('cmf_mail')
    op.drop_index(op.f('ix_cmf_mail_spectators_root_id'), table_name='cmf_mail_spectators')
    op.drop_index(op.f('ix_cmf_mail_spectators_right_id'), table_name='cmf_mail_spectators')
    op.drop_index(op.f('ix_cmf_mail_spectators_parent_id'), table_name='cmf_mail_spectators')
    op.drop_index(op.f('ix_cmf_mail_spectators_left_id'), table_name='cmf_mail_spectators')
    op.drop_table('cmf_mail_spectators')
    op.drop_index(op.f('ix_cmf_mail_related_objects_root_id'), table_name='cmf_mail_related_objects')
    op.drop_index(op.f('ix_cmf_mail_related_objects_right_id'), table_name='cmf_mail_related_objects')
    op.drop_index(op.f('ix_cmf_mail_related_objects_parent_id'), table_name='cmf_mail_related_objects')
    op.drop_index(op.f('ix_cmf_mail_related_objects_left_id'), table_name='cmf_mail_related_objects')
    op.drop_table('cmf_mail_related_objects')
    op.drop_index(op.f('ix_cmf_mail_executors_root_id'), table_name='cmf_mail_executors')
    op.drop_index(op.f('ix_cmf_mail_executors_right_id'), table_name='cmf_mail_executors')
    op.drop_index(op.f('ix_cmf_mail_executors_parent_id'), table_name='cmf_mail_executors')
    op.drop_index(op.f('ix_cmf_mail_executors_left_id'), table_name='cmf_mail_executors')
    op.drop_table('cmf_mail_executors')
    op.drop_index(op.f('ix_cmf_form_name'), table_name='cmf_form')
    op.drop_index(op.f('ix_cmf_form_code'), table_name='cmf_form')
    op.drop_index(op.f('ix_cmf_form_cmf_viewed_at'), table_name='cmf_form')
    op.drop_index(op.f('ix_cmf_form_cmf_version'), table_name='cmf_form')
    op.drop_index(op.f('ix_cmf_form_cmf_owner_id'), table_name='cmf_form')
    op.drop_index(op.f('ix_cmf_form_cmf_modified_by_id'), table_name='cmf_form')
    op.drop_index(op.f('ix_cmf_form_cmf_modified_at'), table_name='cmf_form')
    op.drop_index(op.f('ix_cmf_form_cmf_locked_by_id'), table_name='cmf_form')
    op.drop_index(op.f('ix_cmf_form_cmf_locked_at'), table_name='cmf_form')
    op.drop_index(op.f('ix_cmf_form_cmf_deleted'), table_name='cmf_form')
    op.drop_index(op.f('ix_cmf_form_cmf_created_at'), table_name='cmf_form')
    op.drop_index(op.f('ix_cmf_form_cmf_author_id'), table_name='cmf_form')
    op.drop_table('cmf_form')
    # ### end Alembic commands ###
