"""taskflow_approversfields

Revision ID: 2d66153e20c6
Revises: 913ba10decaa
Create Date: 2023-08-29 12:19:06.954523

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '2d66153e20c6'
down_revision = '913ba10decaa'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('cmf_task_cmf_person',
    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_task.id'], ),
    sa.ForeignKeyConstraint(['right_id'], ['cmf_person.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_task_cmf_person_left_id'), 'cmf_task_cmf_person', ['left_id'], unique=False)
    op.create_index(op.f('ix_cmf_task_cmf_person_parent_id'), 'cmf_task_cmf_person', ['parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_task_cmf_person_right_id'), 'cmf_task_cmf_person', ['right_id'], unique=False)
    op.create_index(op.f('ix_cmf_task_cmf_person_root_id'), 'cmf_task_cmf_person', ['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_person_root_id'), table_name='cmf_task_cmf_person')
    op.drop_index(op.f('ix_cmf_task_cmf_person_right_id'), table_name='cmf_task_cmf_person')
    op.drop_index(op.f('ix_cmf_task_cmf_person_parent_id'), table_name='cmf_task_cmf_person')
    op.drop_index(op.f('ix_cmf_task_cmf_person_left_id'), table_name='cmf_task_cmf_person')
    op.drop_table('cmf_task_cmf_person')
    # ### end Alembic commands ###
