"""add_root_fields

Revision ID: 81791f5fc043
Revises: b6d00d19b1f3
Create Date: 2023-02-06 09:24:41.815700

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '81791f5fc043'
down_revision = 'b6d00d19b1f3'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('cmf_s_desk_request_group', sa.Column('root_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_s_desk_request_group_root_parent_id'), 'cmf_s_desk_request_group', ['root_parent_id'], unique=False)
    op.add_column('cmf_s_desk_request_type', sa.Column('root_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_s_desk_request_type_root_parent_id'), 'cmf_s_desk_request_type', ['root_parent_id'], unique=False)
    op.add_column('cmf_task_queue', sa.Column('root_parent_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_task_queue_root_parent_id'), 'cmf_task_queue', ['root_parent_id'], unique=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_cmf_task_queue_root_parent_id'), table_name='cmf_task_queue')
    op.drop_column('cmf_task_queue', 'root_parent_id')
    op.drop_index(op.f('ix_cmf_s_desk_request_type_root_parent_id'), table_name='cmf_s_desk_request_type')
    op.drop_column('cmf_s_desk_request_type', 'root_parent_id')
    op.drop_index(op.f('ix_cmf_s_desk_request_group_root_parent_id'), table_name='cmf_s_desk_request_group')
    op.drop_column('cmf_s_desk_request_group', 'root_parent_id')
    # ### end Alembic commands ###
