mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-09 13:01:00 +00:00
Add a nullable units_per_dose to medication_schedules so a split-dose plan can consume a different unit count at different times of day (a whole tablet in the morning, a half at noon) on ONE medication instead of two. NULL inherits the medication-level units_per_dose, so every existing row keeps its current behaviour. Migration 0332 adds one nullable Decimal(10,4) column with no backfill.
7 lines
419 B
SQL
7 lines
419 B
SQL
-- #219 — per-schedule inventory units consumed per dose.
|
|
-- Additive, nullable, no backfill: every existing schedule row reads NULL and
|
|
-- the consume hook keeps inheriting the medication-level `units_per_dose`, so
|
|
-- behaviour is unchanged until a user sets a per-slot value. Same
|
|
-- Decimal(10,4) grain as `medications.units_per_dose`.
|
|
ALTER TABLE "medication_schedules" ADD COLUMN "units_per_dose" DECIMAL(10,4);
|