"""empty message

Revision ID: 2914f0e09877
Revises: ba0bdf748dfe
Create Date: 2022-05-22 04:25:11.617494

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '2914f0e09877'
down_revision = 'ba0bdf748dfe'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('cmf_org_unit', 'ou_parent_id', new_column_name='tree_parent_id')
    op.drop_index('ix_cmf_org_unit_ou_parent_id', table_name='cmf_org_unit')
    op.create_index(op.f('ix_cmf_org_unit_tree_parent_id'), 'cmf_org_unit', ['tree_parent_id'], unique=False)

    op.alter_column('cmf_role', 'ou_parent_id', new_column_name='tree_parent_id')
    op.drop_index('ix_cmf_role_ou_parent_id', table_name='cmf_role')
    op.create_index(op.f('ix_cmf_role_tree_parent_id'), 'cmf_role', ['tree_parent_id'], unique=False)
    # ### end Alembic commands ###


def downgrade():
    pass
    # ### commands auto generated by Alembic - please adjust! ###
    #op.add_column('cmf_role', sa.Column('ou_parent_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True))
    #op.drop_index(op.f('ix_cmf_role_tree_parent_id'), table_name='cmf_role')
    #op.create_index('ix_cmf_role_ou_parent_id', 'cmf_role', ['ou_parent_id'], unique=False)
    #op.drop_column('cmf_role', 'tree_parent_id')
    #op.add_column('cmf_org_unit', sa.Column('ou_parent_id', sa.VARCHAR(length=64), autoincrement=False, nullable=True))
    #op.drop_index(op.f('ix_cmf_org_unit_tree_parent_id'), table_name='cmf_org_unit')
    #op.create_index('ix_cmf_org_unit_ou_parent_id', 'cmf_org_unit', ['ou_parent_id'], unique=False)
    #op.drop_column('cmf_org_unit', 'tree_parent_id')
    # ### end Alembic commands ###
