"""Add unique constraint on Order.stripe_invoice_id

Revision ID: 2662afe0a807
Revises: 40fa303ba84e
Create Date: 2024-10-30 10:32:40.018930

"""

import sqlalchemy as sa
from alembic import op

# Polar Custom Imports

# revision identifiers, used by Alembic.
revision = "2662afe0a807"
down_revision = "40fa303ba84e"
branch_labels: tuple[str] | None = None
depends_on: tuple[str] | None = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_unique_constraint(
        op.f("orders_stripe_invoice_id_key"), "orders", ["stripe_invoice_id"]
    )
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(op.f("orders_stripe_invoice_id_key"), "orders", type_="unique")
    # ### end Alembic commands ###
