mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-09 21:10:59 +00:00
The schema declared `MedicationSchedule.daysOfWeek` (mapped to `days_of_week`) but no migration ever created the column. Code paths in src/components/medications/*, src/app/api/medications/*, src/app/api/admin/notifications/reminder-check/*, and the achievements route all reference it via the comma-separated "0,1,3,5" recurrence string. Pre-v1.4.23 deploys silently survived because the existing query sites only selected the column on SELECT — Postgres would have failed loudly the moment a user actually saved a non-default recurrence string via the medication form. Migration `0039_medication_schedule_days_of_week` adds the column nullable, default NULL. NULL means "daily" — `parseScheduleRecurrence(null)` already returns the all-7-days set, so existing rows get the correct semantics without backfill. H5 decision rationale: deploy (Option A) over drop (Option B). The field is referenced by 9 source files across 4 user-visible surfaces (medication form, card, intake list, reminder dispatcher). Removing it would force a UI rewrite of the recurrence picker and break existing test fixtures. Deploying matches the schema's stated intent and unblocks the v1.4.21 senior-dev review's MED-5 flag. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>