mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-10 05:12:14 +00:00
Migration 0057 shipped `onboarding_step INTEGER DEFAULT 0` as nullable so the additive DDL avoided a long table rewrite during the W14b deploy. The wizard mount code and the POST route then carried defensive null-handling branches (read-side `?? 0`, write-side `OR step IS NULL`) to keep legacy pre-W14b rows working. That left a tri-state surface the route had to widen on every step-0 advance. Backfill every NULL row to 0 (the same value the read-path already substitutes), then `ALTER COLUMN ... SET NOT NULL`. schema.prisma drops the `?` so the Prisma type-surface mirrors the DB. The conditional update WHERE in `/api/onboarding/step` collapses to the strict-equality form on every step — the legacy null branch becomes unreachable code and is removed. Fix-O / senior-M1.