"""users.credit_until: timestamp until which a free-tier user has paid-tier access. Set by: - Admin CLI (`python -m app.cli grant-credit `) — manual grants for testing & goodwill, in lieu of Paddle in Phase D.2. - Paddle webhook (Phase D.3) — referral conversion bumps both parties' credit forward by 3 months at 50% off. Null means "no credit". The `is_paid_active` helper in app/services/access.py treats `credit_until > now()` as paid-equivalent. Revision ID: 0014 Revises: 0013 Create Date: 2026-05-21 """ from typing import Sequence, Union import sqlalchemy as sa from alembic import op revision: str = "0014" down_revision: Union[str, None] = "0013" branch_labels: Union[str, Sequence[str], None] = None depends_on: Union[str, Sequence[str], None] = None def upgrade() -> None: op.add_column( "users", sa.Column("credit_until", sa.DateTime(timezone=True), nullable=True), ) def downgrade() -> None: op.drop_column("users", "credit_until")