"""add more browser session history index

Revision ID: 44e95cb21d98
Revises: 24bd4ab81e07
Create Date: 2025-12-04 07:03:22.218433+00:00

"""

from typing import Sequence, Union

import sqlalchemy as sa

from alembic import op

# revision identifiers, used by Alembic.
revision: str = "44e95cb21d98"
down_revision: Union[str, None] = "24bd4ab81e07"
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_status_created",
        "persistent_browser_sessions",
        ["organization_id", "status", sa.literal_column("created_at DESC")],
        unique=False,
    )
    # ### end Alembic commands ###


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