refactor(medications): drop the compliance rollup table that nothing reads

medication_compliance_rollups lost its last reader when compliance moved
to the schedule-anchored computation, yet every dose write still upserted
it, a boot backfill refolded it, and the wipe and backup plans carried it.

The per-dose hook keeps the one derived row that still hangs off a dose
day, the supplement nutrients, under dose-day-refresh. The pending-row
mints (today projection, reminder) no longer call it, since an untaken
dose adds no nutrients. The import job finishes without its per-day
recompute phase; its progress keeps touchedDays and rollupProcessed on
the wire, inert and documented as deprecated. The backfill queue is
retired on boot and migration 0414 drops the table under a bounded lock
wait.
This commit is contained in:
Marc-André Bombeck committed 2026-10-20 13:01:45 +02:00
1 parent b90c82cba3
commit 41de0ca126
71 files changed
+314 -2027

No files matched your search

+8 -6
View File
@@ -9544,10 +9544,9 @@ paths:
defend against a poisoned column. Audit-logged with the old and new zone.
A change is not only a display preference. The medication-compliance rollup keys its rows by the LOCAL day a
dose fell on, minted under whatever zone was in force at write time, so moving the zone re-buckets that history
and the stored keys go stale — and the coverage probe compares counts rather than keys, so it cannot notice. The
route therefore enqueues a re-fold of the trailing window whenever the zone actually changes. Best-effort and
A change is not only a display preference. The supplement nutrient rows key on the LOCAL day a dose fell on,
minted under whatever zone was in force at write time, so moving the zone re-buckets them. The route therefore
enqueues a recompute of the account's supplement nutrients whenever the zone actually changes. Best-effort and
de-duplicated, so rapid re-picks collapse into one.
requestBody:
required: true
@@ -52993,12 +52992,15 @@ components:
type: array
items:
type: string
description: Local calendar days (YYYY-MM-DD) touched so far, driving the chunked rollup recompute behind the write.
description: "Deprecated and inert: always `[]` on a job admitted from v1.43.8, when the per-day compliance rollup it
drove was removed. A job admitted earlier keeps the days it recorded. Kept for clients that decode it; do
not read it."
rollupProcessed:
type: integer
minimum: 0
maximum: 9007199254740991
description: Of `touchedDays`, how many have had their rollup recomputed.
description: "Deprecated and inert: always `0` on a job admitted from v1.43.8. Kept for clients that decode it; do not
read it."
required:
- processed
- total