"""Add performance indexes to agent_instances table

Revision ID: 20de0aa419ca
Revises: 9fe045ea7ad9
Create Date: 2025-08-07 23:20:32.457833

"""

from typing import Sequence, Union

from alembic import op


# revision identifiers, used by Alembic.
revision: str = "20de0aa419ca"
down_revision: Union[str, None] = "9fe045ea7ad9"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_index(
        "idx_agent_instances_user_agent_id",
        "agent_instances",
        ["user_agent_id"],
        unique=False,
    )
    op.create_index(
        "idx_agent_instances_user_status",
        "agent_instances",
        ["user_id", "status"],
        unique=False,
    )
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index("idx_agent_instances_user_status", table_name="agent_instances")
    op.drop_index("idx_agent_instances_user_agent_id", table_name="agent_instances")
    # ### end Alembic commands ###
