"""add browser session history index

Revision ID: 24bd4ab81e07
Revises: 1001a00ed620
Create Date: 2025-12-02 17:17:28.644094+00:00

"""

from typing import Sequence, Union

from alembic import op

# revision identifiers, used by Alembic.
revision: str = "24bd4ab81e07"
down_revision: Union[str, None] = "1001a00ed620"
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_persistent_browser_sessions_org_created_started_completed",
        "persistent_browser_sessions",
        ["organization_id", "created_at", "started_at", "completed_at"],
        unique=False,
    )
    # ### end Alembic commands ###


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