"""empty message

Revision ID: 9d3a72693260
Revises: b9b5a9645100
Create Date: 2024-08-03 16:44:23.050387

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = '9d3a72693260'
down_revision = 'b9b5a9645100'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('cmf_cust_field', sa.Column('fullsearch_index', sa.Boolean(), nullable=False, server_default='false'))
    op.add_column('cmf_full_search', sa.Column('obj_custom_fields', sa.TEXT(), nullable=True))
    op.add_column('cmf_full_search', sa.Column('custom_fields_tsvector', postgresql.TSVECTOR(), nullable=True))
    op.create_index('ix_cmf_full_search_custom_fields_tsvector_gin', 'cmf_full_search', ['custom_fields_tsvector'], unique=False, postgresql_using='gin')
    op.create_index('ix_cmf_full_search_obj_custom_fields_gin_trgm', 'cmf_full_search', ['obj_custom_fields'], unique=False, postgresql_using='gin', postgresql_ops={'obj_custom_fields': 'gin_trgm_ops'})
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('cmf_cust_field', 'fullsearch_index')
    op.drop_index('ix_cmf_full_search_obj_custom_fields_gin_trgm', table_name='cmf_full_search', postgresql_using='gin', postgresql_ops={'obj_custom_fields': 'gin_trgm_ops'})
    op.drop_index('ix_cmf_full_search_custom_fields_tsvector_gin', table_name='cmf_full_search', postgresql_using='gin')
    op.drop_column('cmf_full_search', 'custom_fields_tsvector')
    op.drop_column('cmf_full_search', 'obj_custom_fields')
    # ### end Alembic commands ###
