"""add_mention_task_document_m2m

Revision ID: ebc8e4148939
Revises: bca0e39f7af3
Create Date: 2022-07-07 06:36:16.244132

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'ebc8e4148939'
down_revision = 'bca0e39f7af3'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('cmf_task_cmf_document',
    sa.Column('id', sa.String(length=64), 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_task.id'], ),
    sa.ForeignKeyConstraint(['right_id'], ['cmf_document.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_task_cmf_document_left_id'), 'cmf_task_cmf_document', ['left_id'], unique=False)
    op.create_index(op.f('ix_cmf_task_cmf_document_parent_id'), 'cmf_task_cmf_document', ['parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_task_cmf_document_right_id'), 'cmf_task_cmf_document', ['right_id'], unique=False)
    op.create_index(op.f('ix_cmf_task_cmf_document_root_id'), 'cmf_task_cmf_document', ['root_id'], unique=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_cmf_task_cmf_document_root_id'), table_name='cmf_task_cmf_document')
    op.drop_index(op.f('ix_cmf_task_cmf_document_right_id'), table_name='cmf_task_cmf_document')
    op.drop_index(op.f('ix_cmf_task_cmf_document_parent_id'), table_name='cmf_task_cmf_document')
    op.drop_index(op.f('ix_cmf_task_cmf_document_left_id'), table_name='cmf_task_cmf_document')
    op.drop_table('cmf_task_cmf_document')
    # ### end Alembic commands ###
