"""license key add unique constraint

Revision ID: 4ef14889c3d9
Revises: c626a362784d
Create Date: 2024-08-21 16:21:59.053358

"""

import sqlalchemy as sa
from alembic import op

# Polar Custom Imports

# revision identifiers, used by Alembic.
revision = "4ef14889c3d9"
down_revision = "c626a362784d"
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("license_keys_user_id_benefit_id_key"),
        "license_keys",
        ["user_id", "benefit_id"],
    )
    # ### end Alembic commands ###


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