"""Add index on Order.status

Revision ID: c26960e60bda
Revises: 25b8cacd8269
Create Date: 2025-09-04 12:05:40.281965

"""

import sqlalchemy as sa
from alembic import op

# Polar Custom Imports

# revision identifiers, used by Alembic.
revision = "c26960e60bda"
down_revision = "25b8cacd8269"
branch_labels: tuple[str] | None = None
depends_on: tuple[str] | None = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    with op.get_context().autocommit_block():
        op.create_index(
            op.f("ix_orders_status"),
            "orders",
            ["status"],
            unique=False,
            postgresql_concurrently=True,
        )
    # ### end Alembic commands ###


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