"""Add Subscription.legacy_stripe_subscription_id

Revision ID: 3e8e0dcee197
Revises: 715685e22026
Create Date: 2025-09-24 09:52:32.987253

"""

import sqlalchemy as sa
from alembic import op

# Polar Custom Imports

# revision identifiers, used by Alembic.
revision = "3e8e0dcee197"
down_revision = "715685e22026"
branch_labels: tuple[str] | None = None
depends_on: tuple[str] | None = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        "subscriptions",
        sa.Column("legacy_stripe_subscription_id", sa.String(), nullable=True),
    )
    op.create_index(
        op.f("ix_subscriptions_legacy_stripe_subscription_id"),
        "subscriptions",
        ["legacy_stripe_subscription_id"],
        unique=False,
    )
    # ### end Alembic commands ###


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