"""Reset included_units default

Revision ID: 521379c7f641
Revises: 26bf49ca1f06
Create Date: 2025-03-28 14:00:34.101295

"""

import sqlalchemy as sa
from alembic import op

# Polar Custom Imports

# revision identifiers, used by Alembic.
revision = "521379c7f641"
down_revision = "26bf49ca1f06"
branch_labels: tuple[str] | None = None
depends_on: tuple[str] | None = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.execute("""
        UPDATE product_prices
        SET included_units = NULL
        WHERE included_units = 0 and amount_type != 'metered_unit'
        """)
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    pass
    # ### end Alembic commands ###
