mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-09 13:01:00 +00:00
Migrations 0402 to 0410: AI usage levels, biomarker aliases and merges, medication ingredients (with the supplement label run kind), life circumstance fact kinds, AI sections and AUDIT-C, Dawarich context, the pulse day-mean method, intraday hour buckets, the readable location drop and five relation link tables. Every new column carries its reader or a pending-consumer marker. 0409 refuses to run while any home, location period or stored day still holds a readable location, and names the counts. Locations are read from the sealed copy only; the encryption backfill no longer handles them, and the demo seed writes sealed locations only. The new tables are backed up and wiped, the new sealed columns are in the rotation registry with labels of their own, the AI usage level and the life-circumstance confirmations travel with the backup, and the wellbeing score reads the mental-health screeners only.
15 lines
598 B
SQL
15 lines
598 B
SQL
-- Pulse day-mean method (#1107 follow-up).
|
|
--
|
|
-- The method every pulse day-mean reader uses, switched only by the admin
|
|
-- apply step after a dry run. `hour_mean_v1` is the behaviour up to v1.42.
|
|
|
|
-- AlterTable
|
|
ALTER TABLE "app_settings"
|
|
ADD COLUMN "pulse_day_mean_method" TEXT NOT NULL DEFAULT 'hour_mean_v1',
|
|
ADD COLUMN "pulse_day_mean_applied_at" TIMESTAMP(3),
|
|
ADD COLUMN "pulse_day_mean_dry_run_json" JSONB;
|
|
|
|
ALTER TABLE "app_settings"
|
|
ADD CONSTRAINT "app_settings_pulse_day_mean_method_check"
|
|
CHECK ("pulse_day_mean_method" IN ('hour_mean_v1', 'weighted_hour_mean_v2'));
|