"""Add orders.product_id index

Revision ID: a3ba9e3475b9
Revises: a7c4fe33ecec
Create Date: 2025-09-01 22:09:41.029842

"""

import sqlalchemy as sa
from alembic import op

# Polar Custom Imports

# revision identifiers, used by Alembic.
revision = "a3ba9e3475b9"
down_revision = "a7c4fe33ecec"
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_product_id"),
            "orders",
            ["product_id"],
            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_product_id"), table_name="orders")
    # ### end Alembic commands ###
