"""Fix spec code name indexes

Revision ID: 913f1daaead1
Revises: a7d4b6a52fd7
Create Date: 2025-11-06 13:03:14.231159

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '913f1daaead1'
down_revision = 'a7d4b6a52fd7'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    # Пока не исправили "не пустой алембик" были кривые сборки с этими индексами...
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_access_list_code_gin_trgm ON cmf_access_list USING gin (code gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_access_list_name_gin_trgm ON cmf_access_list USING gin (name gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_activity_code_gin_trgm ON cmf_activity USING gin (code gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_approve_name_gin_trgm ON cmf_approve USING gin (name gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_auth_plugin_data_code_gin_trgm ON cmf_auth_plugin_data USING gin (code gin_trgm_ops)')
    op.create_index(op.f('ix_cmf_auth_plugin_data_name'), 'cmf_auth_plugin_data', ['name'], unique=False)
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_auth_plugin_data_name_gin_trgm ON cmf_auth_plugin_data USING gin (name gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_card_name_gin_trgm ON cmf_card USING gin (name gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_chat_group_name_gin_trgm ON cmf_chat_group USING gin (name gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_chat_topic_name_gin_trgm ON cmf_chat_topic USING gin (name gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_checklist_code_gin_trgm ON cmf_checklist USING gin (code gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_checklist_name_gin_trgm ON cmf_checklist USING gin (name gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_checklist_item_code_gin_trgm ON cmf_checklist_item USING gin (code gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_checklist_item_name_gin_trgm ON cmf_checklist_item USING gin (name gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_comment_name_gin_trgm ON cmf_comment USING gin (name gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_company_name_gin_trgm ON cmf_company USING gin (name gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_course_document_result_code_gin_trgm ON cmf_course_document_result USING gin (code gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_course_document_result_name_gin_trgm ON cmf_course_document_result USING gin (name gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_course_progress_code_gin_trgm ON cmf_course_progress USING gin (code gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_course_progress_name_gin_trgm ON cmf_course_progress USING gin (name gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_currency_code_gin_trgm ON cmf_currency USING gin (code gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_currency_name_gin_trgm ON cmf_currency USING gin (name gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_document_history_name_gin_trgm ON cmf_document_history USING gin (name gin_trgm_ops)')
    op.alter_column('cmf_evagit_branch', 'name',
               existing_type=sa.VARCHAR(length=64),
               type_=sa.String(length=256),
               existing_nullable=False)
    op.create_index(op.f('ix_cmf_evagit_branch_name'), 'cmf_evagit_branch', ['name'], unique=False)
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_evagit_branch_name_gin_trgm ON cmf_evagit_branch USING gin (name gin_trgm_ops)')
    op.create_index(op.f('ix_cmf_evagit_commit_name'), 'cmf_evagit_commit', ['name'], unique=False)
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_evagit_commit_name_gin_trgm ON cmf_evagit_commit USING gin (name gin_trgm_ops)')
    op.alter_column('cmf_evagit_group', 'name',
               existing_type=sa.VARCHAR(length=64),
               type_=sa.String(length=256),
               existing_nullable=True)
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_evagit_group_name_gin_trgm ON cmf_evagit_group USING gin (name gin_trgm_ops)')
    op.alter_column('cmf_evagit_merge_request', 'name',
               existing_type=sa.VARCHAR(length=64),
               type_=sa.String(length=256),
               existing_nullable=True)
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_evagit_merge_request_name_gin_trgm ON cmf_evagit_merge_request USING gin (name gin_trgm_ops)')
    op.alter_column('cmf_evagit_repo', 'name',
               existing_type=sa.VARCHAR(length=64),
               type_=sa.String(length=256),
               existing_nullable=True)
    op.create_index(op.f('ix_cmf_evagit_repo_name'), 'cmf_evagit_repo', ['name'], unique=False)
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_evagit_repo_name_gin_trgm ON cmf_evagit_repo USING gin (name gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_exam_question_folder_result_code_gin_trgm ON cmf_exam_question_folder_result USING gin (code gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_exam_question_folder_result_name_gin_trgm ON cmf_exam_question_folder_result USING gin (name gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_exam_result_code_gin_trgm ON cmf_exam_result USING gin (code gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_exam_result_name_gin_trgm ON cmf_exam_result USING gin (name gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_follower_code_gin_trgm ON cmf_follower USING gin (code gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_follower_name_gin_trgm ON cmf_follower USING gin (name gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_form_field_code_gin_trgm ON cmf_form_field USING gin (code gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_form_field_name_gin_trgm ON cmf_form_field USING gin (name gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_git_branch_name_gin_trgm ON cmf_git_branch USING gin (name gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_git_merge_request_name_gin_trgm ON cmf_git_merge_request USING gin (name gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_git_repo_name_gin_trgm ON cmf_git_repo USING gin (name gin_trgm_ops)')
    op.create_index(op.f('ix_cmf_invoice_items_name'), 'cmf_invoice_items', ['name'], unique=False)
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_invoice_items_name_gin_trgm ON cmf_invoice_items USING gin (name gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_kanban_board_code_gin_trgm ON cmf_kanban_board USING gin (code gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_kanban_board_name_gin_trgm ON cmf_kanban_board USING gin (name gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_kanban_board_column_code_gin_trgm ON cmf_kanban_board_column USING gin (code gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_kanban_board_column_name_gin_trgm ON cmf_kanban_board_column USING gin (name gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_list_code_gin_trgm ON cmf_list USING gin (code gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_list_name_gin_trgm ON cmf_list USING gin (name gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_logic_type_name_gin_trgm ON cmf_logic_type USING gin (name gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_org_unit_code_gin_trgm ON cmf_org_unit USING gin (code gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_org_unit_name_gin_trgm ON cmf_org_unit USING gin (name gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_person_achievement_code_gin_trgm ON cmf_person_achievement USING gin (code gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_person_achievement_name_gin_trgm ON cmf_person_achievement USING gin (name gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_person_group_code_gin_trgm ON cmf_person_group USING gin (code gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_person_group_name_gin_trgm ON cmf_person_group USING gin (name gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_pipeline_code_gin_trgm ON cmf_pipeline USING gin (code gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_pipeline_name_gin_trgm ON cmf_pipeline USING gin (name gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_price_name_gin_trgm ON cmf_price USING gin (name gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_question_result_code_gin_trgm ON cmf_question_result USING gin (code gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_question_result_name_gin_trgm ON cmf_question_result USING gin (name gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_relation_option_name_gin_trgm ON cmf_relation_option USING gin (name gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_rep_line_chart_row_code_gin_trgm ON cmf_rep_line_chart_row USING gin (code gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_rep_line_chart_row_name_gin_trgm ON cmf_rep_line_chart_row USING gin (name gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_roadmap_name_gin_trgm ON cmf_roadmap USING gin (name gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_role_code_gin_trgm ON cmf_role USING gin (code gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_role_name_gin_trgm ON cmf_role USING gin (name gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_status_code_gin_trgm ON cmf_status USING gin (code gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_tag_name_gin_trgm ON cmf_tag USING gin (name gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_task_name_gin_trgm ON cmf_task USING gin (name gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_test_param_code_gin_trgm ON cmf_test_param USING gin (code gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_test_param_name_gin_trgm ON cmf_test_param USING gin (name gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_test_param_row_value_code_gin_trgm ON cmf_test_param_row_value USING gin (code gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_test_param_row_value_name_gin_trgm ON cmf_test_param_row_value USING gin (name gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_test_param_value_code_gin_trgm ON cmf_test_param_value USING gin (code gin_trgm_ops)')
    op.create_index(op.f('ix_cmf_test_param_value_name'), 'cmf_test_param_value', ['name'], unique=False)
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_test_param_value_name_gin_trgm ON cmf_test_param_value USING gin (name gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_test_params_row_code_gin_trgm ON cmf_test_params_row USING gin (code gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_test_params_row_name_gin_trgm ON cmf_test_params_row USING gin (name gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_testcase_run_name_gin_trgm ON cmf_testcase_run USING gin (name gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_testcase_run_history_step_name_gin_trgm ON cmf_testcase_run_history_step USING gin (name gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_testcase_step_code_gin_trgm ON cmf_testcase_step USING gin (code gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_testcase_step_name_gin_trgm ON cmf_testcase_step USING gin (name gin_trgm_ops)')
    op.execute('CREATE INDEX IF NOT EXISTS ix_cmf_time_tracker_history_name_gin_trgm ON cmf_time_tracker_history USING gin (name gin_trgm_ops)')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index('ix_cmf_time_tracker_history_name_gin_trgm', table_name='cmf_time_tracker_history', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_testcase_step_name_gin_trgm', table_name='cmf_testcase_step', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_testcase_step_code_gin_trgm', table_name='cmf_testcase_step', postgresql_using='gin', postgresql_ops={'code': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_testcase_run_history_step_name_gin_trgm', table_name='cmf_testcase_run_history_step', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_testcase_run_name_gin_trgm', table_name='cmf_testcase_run', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_test_params_row_name_gin_trgm', table_name='cmf_test_params_row', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_test_params_row_code_gin_trgm', table_name='cmf_test_params_row', postgresql_using='gin', postgresql_ops={'code': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_test_param_value_name_gin_trgm', table_name='cmf_test_param_value', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index(op.f('ix_cmf_test_param_value_name'), table_name='cmf_test_param_value')
    op.drop_index('ix_cmf_test_param_value_code_gin_trgm', table_name='cmf_test_param_value', postgresql_using='gin', postgresql_ops={'code': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_test_param_row_value_name_gin_trgm', table_name='cmf_test_param_row_value', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_test_param_row_value_code_gin_trgm', table_name='cmf_test_param_row_value', postgresql_using='gin', postgresql_ops={'code': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_test_param_name_gin_trgm', table_name='cmf_test_param', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_test_param_code_gin_trgm', table_name='cmf_test_param', postgresql_using='gin', postgresql_ops={'code': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_task_name_gin_trgm', table_name='cmf_task', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_tag_name_gin_trgm', table_name='cmf_tag', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_status_code_gin_trgm', table_name='cmf_status', postgresql_using='gin', postgresql_ops={'code': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_role_name_gin_trgm', table_name='cmf_role', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_role_code_gin_trgm', table_name='cmf_role', postgresql_using='gin', postgresql_ops={'code': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_roadmap_name_gin_trgm', table_name='cmf_roadmap', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_rep_line_chart_row_name_gin_trgm', table_name='cmf_rep_line_chart_row', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_rep_line_chart_row_code_gin_trgm', table_name='cmf_rep_line_chart_row', postgresql_using='gin', postgresql_ops={'code': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_relation_option_name_gin_trgm', table_name='cmf_relation_option', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_question_result_name_gin_trgm', table_name='cmf_question_result', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_question_result_code_gin_trgm', table_name='cmf_question_result', postgresql_using='gin', postgresql_ops={'code': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_price_name_gin_trgm', table_name='cmf_price', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_pipeline_name_gin_trgm', table_name='cmf_pipeline', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_pipeline_code_gin_trgm', table_name='cmf_pipeline', postgresql_using='gin', postgresql_ops={'code': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_person_group_name_gin_trgm', table_name='cmf_person_group', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_person_group_code_gin_trgm', table_name='cmf_person_group', postgresql_using='gin', postgresql_ops={'code': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_person_achievement_name_gin_trgm', table_name='cmf_person_achievement', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_person_achievement_code_gin_trgm', table_name='cmf_person_achievement', postgresql_using='gin', postgresql_ops={'code': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_org_unit_name_gin_trgm', table_name='cmf_org_unit', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_org_unit_code_gin_trgm', table_name='cmf_org_unit', postgresql_using='gin', postgresql_ops={'code': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_logic_type_name_gin_trgm', table_name='cmf_logic_type', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_list_name_gin_trgm', table_name='cmf_list', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_list_code_gin_trgm', table_name='cmf_list', postgresql_using='gin', postgresql_ops={'code': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_kanban_board_column_name_gin_trgm', table_name='cmf_kanban_board_column', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_kanban_board_column_code_gin_trgm', table_name='cmf_kanban_board_column', postgresql_using='gin', postgresql_ops={'code': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_kanban_board_name_gin_trgm', table_name='cmf_kanban_board', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_kanban_board_code_gin_trgm', table_name='cmf_kanban_board', postgresql_using='gin', postgresql_ops={'code': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_invoice_items_name_gin_trgm', table_name='cmf_invoice_items', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index(op.f('ix_cmf_invoice_items_name'), table_name='cmf_invoice_items')
    op.drop_index('ix_cmf_git_repo_name_gin_trgm', table_name='cmf_git_repo', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_git_merge_request_name_gin_trgm', table_name='cmf_git_merge_request', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_git_branch_name_gin_trgm', table_name='cmf_git_branch', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_form_field_name_gin_trgm', table_name='cmf_form_field', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_form_field_code_gin_trgm', table_name='cmf_form_field', postgresql_using='gin', postgresql_ops={'code': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_follower_name_gin_trgm', table_name='cmf_follower', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_follower_code_gin_trgm', table_name='cmf_follower', postgresql_using='gin', postgresql_ops={'code': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_exam_result_name_gin_trgm', table_name='cmf_exam_result', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_exam_result_code_gin_trgm', table_name='cmf_exam_result', postgresql_using='gin', postgresql_ops={'code': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_exam_question_folder_result_name_gin_trgm', table_name='cmf_exam_question_folder_result', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_exam_question_folder_result_code_gin_trgm', table_name='cmf_exam_question_folder_result', postgresql_using='gin', postgresql_ops={'code': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_evagit_repo_name_gin_trgm', table_name='cmf_evagit_repo', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index(op.f('ix_cmf_evagit_repo_name'), table_name='cmf_evagit_repo')
    op.alter_column('cmf_evagit_repo', 'name',
               existing_type=sa.String(length=256),
               type_=sa.VARCHAR(length=64),
               existing_nullable=True)
    op.drop_index('ix_cmf_evagit_merge_request_name_gin_trgm', table_name='cmf_evagit_merge_request', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.alter_column('cmf_evagit_merge_request', 'name',
               existing_type=sa.String(length=256),
               type_=sa.VARCHAR(length=64),
               existing_nullable=True)
    op.drop_index('ix_cmf_evagit_group_name_gin_trgm', table_name='cmf_evagit_group', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.alter_column('cmf_evagit_group', 'name',
               existing_type=sa.String(length=256),
               type_=sa.VARCHAR(length=64),
               existing_nullable=True)
    op.drop_index('ix_cmf_evagit_commit_name_gin_trgm', table_name='cmf_evagit_commit', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index(op.f('ix_cmf_evagit_commit_name'), table_name='cmf_evagit_commit')
    op.drop_index('ix_cmf_evagit_branch_name_gin_trgm', table_name='cmf_evagit_branch', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index(op.f('ix_cmf_evagit_branch_name'), table_name='cmf_evagit_branch')
    op.alter_column('cmf_evagit_branch', 'name',
               existing_type=sa.String(length=256),
               type_=sa.VARCHAR(length=64),
               existing_nullable=False)
    op.drop_index('ix_cmf_document_history_name_gin_trgm', table_name='cmf_document_history', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_currency_name_gin_trgm', table_name='cmf_currency', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_currency_code_gin_trgm', table_name='cmf_currency', postgresql_using='gin', postgresql_ops={'code': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_course_progress_name_gin_trgm', table_name='cmf_course_progress', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_course_progress_code_gin_trgm', table_name='cmf_course_progress', postgresql_using='gin', postgresql_ops={'code': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_course_document_result_name_gin_trgm', table_name='cmf_course_document_result', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_course_document_result_code_gin_trgm', table_name='cmf_course_document_result', postgresql_using='gin', postgresql_ops={'code': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_company_name_gin_trgm', table_name='cmf_company', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_comment_name_gin_trgm', table_name='cmf_comment', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_checklist_item_name_gin_trgm', table_name='cmf_checklist_item', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_checklist_item_code_gin_trgm', table_name='cmf_checklist_item', postgresql_using='gin', postgresql_ops={'code': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_checklist_name_gin_trgm', table_name='cmf_checklist', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_checklist_code_gin_trgm', table_name='cmf_checklist', postgresql_using='gin', postgresql_ops={'code': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_chat_topic_name_gin_trgm', table_name='cmf_chat_topic', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_chat_group_name_gin_trgm', table_name='cmf_chat_group', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_card_name_gin_trgm', table_name='cmf_card', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_auth_plugin_data_name_gin_trgm', table_name='cmf_auth_plugin_data', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index(op.f('ix_cmf_auth_plugin_data_name'), table_name='cmf_auth_plugin_data')
    op.drop_index('ix_cmf_auth_plugin_data_code_gin_trgm', table_name='cmf_auth_plugin_data', postgresql_using='gin', postgresql_ops={'code': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_approve_name_gin_trgm', table_name='cmf_approve', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_activity_code_gin_trgm', table_name='cmf_activity', postgresql_using='gin', postgresql_ops={'code': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_access_list_name_gin_trgm', table_name='cmf_access_list', postgresql_using='gin', postgresql_ops={'name': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_access_list_code_gin_trgm', table_name='cmf_access_list', postgresql_using='gin', postgresql_ops={'code': 'gin_trgm_ops'})
    # ### end Alembic commands ###
