"""drop cmf_acl table

Revision ID: ccbe7dfae0c1
Revises: d29b65965287
Create Date: 2022-07-21 12:27:43.765328

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'ccbe7dfae0c1'
down_revision = 'd29b65965287'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index('ix_cmf_acl_subjects_left_id', table_name='cmf_acl_subjects')
    op.drop_index('ix_cmf_acl_subjects_parent_id', table_name='cmf_acl_subjects')
    op.drop_index('ix_cmf_acl_subjects_right_id', table_name='cmf_acl_subjects')
    op.drop_index('ix_cmf_acl_subjects_root_id', table_name='cmf_acl_subjects')
    op.drop_table('cmf_acl_subjects')
    op.drop_index('ix_cmf_acl_orderno', table_name='cmf_acl')
    op.drop_table('cmf_acl')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('cmf_acl',
    sa.Column('id', sa.VARCHAR(length=64), autoincrement=False, nullable=False),
    sa.Column('orderno', sa.INTEGER(), autoincrement=False, nullable=True),
    sa.Column('disabled', sa.BOOLEAN(), autoincrement=False, nullable=True),
    sa.Column('sys_type', sa.VARCHAR(), autoincrement=False, nullable=True),
    sa.Column('access_level', sa.VARCHAR(length=32), autoincrement=False, nullable=True),
    sa.Column('object_id', sa.VARCHAR(length=64), autoincrement=False, nullable=False),
    sa.Column('object_field', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.PrimaryKeyConstraint('id', name='cmf_acl_pkey')
    )
    op.create_index('ix_cmf_acl_orderno', 'cmf_acl', ['orderno'], unique=False)
    op.create_table('cmf_acl_subjects',
    sa.Column('id', sa.VARCHAR(length=64), autoincrement=False, nullable=False),
    sa.Column('parent_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('root_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('description', sa.VARCHAR(length=4096), autoincrement=False, nullable=True),
    sa.Column('left_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('right_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True),
    sa.Column('left_name_cache', sa.VARCHAR(length=256), autoincrement=False, nullable=True),
    sa.Column('right_name_cache', sa.VARCHAR(length=256), autoincrement=False, nullable=True),
    sa.PrimaryKeyConstraint('id', name='cmf_acl_subjects_pkey')
    )
    op.create_index('ix_cmf_acl_subjects_root_id', 'cmf_acl_subjects', ['root_id'], unique=False)
    op.create_index('ix_cmf_acl_subjects_right_id', 'cmf_acl_subjects', ['right_id'], unique=False)
    op.create_index('ix_cmf_acl_subjects_parent_id', 'cmf_acl_subjects', ['parent_id'], unique=False)
    op.create_index('ix_cmf_acl_subjects_left_id', 'cmf_acl_subjects', ['left_id'], unique=False)
    # ### end Alembic commands ###
