"""Add compound indexes for lab_test_components performance

Revision ID: f7b3b520eaa8
Revises: 4edca606d456
Create Date: 2025-09-30 11:50:11.893311

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'f7b3b520eaa8'
down_revision = '4edca606d456'
branch_labels = None
depends_on = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_index('idx_lab_test_components_abbreviation_text', 'lab_test_components', ['abbreviation'], unique=False)
    op.create_index('idx_lab_test_components_lab_result_category', 'lab_test_components', ['lab_result_id', 'category'], unique=False)
    op.create_index('idx_lab_test_components_lab_result_status', 'lab_test_components', ['lab_result_id', 'status'], unique=False)
    op.create_index('idx_lab_test_components_test_name_text', 'lab_test_components', ['test_name'], unique=False)
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index('idx_lab_test_components_test_name_text', table_name='lab_test_components')
    op.drop_index('idx_lab_test_components_lab_result_status', table_name='lab_test_components')
    op.drop_index('idx_lab_test_components_lab_result_category', table_name='lab_test_components')
    op.drop_index('idx_lab_test_components_abbreviation_text', table_name='lab_test_components')
    # ### end Alembic commands ###
