"""Add index on inferences for id, task_id, created_at

Revision ID: f955f6625002
Revises: 82e280cdac06
Create Date: 2024-10-20 09:49:17.280428

"""

from alembic import op

# revision identifiers, used by Alembic.
revision = "f955f6625002"
down_revision = "82e280cdac06"
branch_labels = None
depends_on = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_index(
        "idx_inferences_task_id_created_at",
        "inferences",
        ["task_id", "created_at"],
        unique=False,
        postgresql_ops={"created_at": "DESC"},
    )
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(
        "idx_inferences_task_id_created_at",
        table_name="inferences",
        postgresql_ops={"created_at": "DESC"},
    )
    # ### end Alembic commands ###
