"""Add index to Checkout.organization_id

Revision ID: 6845646317f9
Revises: 08e659ee3871
Create Date: 2025-10-29 16:52:12.701871

"""

import sqlalchemy as sa
from alembic import op

# Polar Custom Imports

# revision identifiers, used by Alembic.
revision = "6845646317f9"
down_revision = "08e659ee3871"
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_checkouts_organization_id"),
            "checkouts",
            ["organization_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_checkouts_organization_id"), table_name="checkouts")
    # ### end Alembic commands ###
