"""add hint docs fields

Revision ID: 771e949a26b5
Revises: 4aa937715738
Create Date: 2025-10-02 09:53:55.561118

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '771e949a26b5'
down_revision = '4aa937715738'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('cmf_s_desk_request_type_hint_docs_mandatory_tags',
    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.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_s_desk_request_type_hint_docs_mandatory_tags_left_id'), 'cmf_s_desk_request_type_hint_docs_mandatory_tags', ['left_id'], unique=False)
    op.create_index(op.f('ix_cmf_s_desk_request_type_hint_docs_mandatory_tags_parent_id'), 'cmf_s_desk_request_type_hint_docs_mandatory_tags', ['parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_s_desk_request_type_hint_docs_mandatory_tags_right_id'), 'cmf_s_desk_request_type_hint_docs_mandatory_tags', ['right_id'], unique=False)
    op.create_index(op.f('ix_cmf_s_desk_request_type_hint_docs_mandatory_tags_root_id'), 'cmf_s_desk_request_type_hint_docs_mandatory_tags', ['root_id'], unique=False)
    op.create_table('cmf_task_sdesk_hint_docs',
    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.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_task_sdesk_hint_docs_left_id'), 'cmf_task_sdesk_hint_docs', ['left_id'], unique=False)
    op.create_index(op.f('ix_cmf_task_sdesk_hint_docs_parent_id'), 'cmf_task_sdesk_hint_docs', ['parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_task_sdesk_hint_docs_right_id'), 'cmf_task_sdesk_hint_docs', ['right_id'], unique=False)
    op.create_index(op.f('ix_cmf_task_sdesk_hint_docs_root_id'), 'cmf_task_sdesk_hint_docs', ['root_id'], unique=False)
    op.add_column('cmf_s_desk_request_type', sa.Column('hint_docs_portal_hide', sa.Boolean(), nullable=False, server_default='false'))
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('cmf_s_desk_request_type', 'hint_docs_portal_hide')
    op.drop_index(op.f('ix_cmf_task_sdesk_hint_docs_root_id'), table_name='cmf_task_sdesk_hint_docs')
    op.drop_index(op.f('ix_cmf_task_sdesk_hint_docs_right_id'), table_name='cmf_task_sdesk_hint_docs')
    op.drop_index(op.f('ix_cmf_task_sdesk_hint_docs_parent_id'), table_name='cmf_task_sdesk_hint_docs')
    op.drop_index(op.f('ix_cmf_task_sdesk_hint_docs_left_id'), table_name='cmf_task_sdesk_hint_docs')
    op.drop_table('cmf_task_sdesk_hint_docs')
    op.drop_index(op.f('ix_cmf_s_desk_request_type_hint_docs_mandatory_tags_root_id'), table_name='cmf_s_desk_request_type_hint_docs_mandatory_tags')
    op.drop_index(op.f('ix_cmf_s_desk_request_type_hint_docs_mandatory_tags_right_id'), table_name='cmf_s_desk_request_type_hint_docs_mandatory_tags')
    op.drop_index(op.f('ix_cmf_s_desk_request_type_hint_docs_mandatory_tags_parent_id'), table_name='cmf_s_desk_request_type_hint_docs_mandatory_tags')
    op.drop_index(op.f('ix_cmf_s_desk_request_type_hint_docs_mandatory_tags_left_id'), table_name='cmf_s_desk_request_type_hint_docs_mandatory_tags')
    op.drop_table('cmf_s_desk_request_type_hint_docs_mandatory_tags')
    # ### end Alembic commands ###
