mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-13 06:32:03 +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.
28 lines
1.2 KiB
SQL
28 lines
1.2 KiB
SQL
-- Life circumstances (#614).
|
|
--
|
|
-- Six new structured fact kinds (sealed JSON values, `schema: 1`), four new
|
|
-- AI sections that are never in the column default, AUDIT-C as an assessment
|
|
-- instrument, and the per-section "still true" confirmations. The new enum
|
|
-- values are added only; nothing in this migration uses them, so the
|
|
-- in-transaction ADD VALUE restriction does not apply.
|
|
|
|
-- AlterEnum
|
|
ALTER TYPE "health_profile_fact_kind" ADD VALUE 'TOBACCO_DETAIL';
|
|
ALTER TYPE "health_profile_fact_kind" ADD VALUE 'ACTIVITY_HABIT';
|
|
ALTER TYPE "health_profile_fact_kind" ADD VALUE 'WORK_CONTEXT';
|
|
ALTER TYPE "health_profile_fact_kind" ADD VALUE 'FREE_WEEKDAYS';
|
|
ALTER TYPE "health_profile_fact_kind" ADD VALUE 'HABITS';
|
|
ALTER TYPE "health_profile_fact_kind" ADD VALUE 'HEALTH_GOALS';
|
|
|
|
-- AlterEnum
|
|
ALTER TYPE "health_profile_ai_section" ADD VALUE 'ACTIVITY';
|
|
ALTER TYPE "health_profile_ai_section" ADD VALUE 'WORK';
|
|
ALTER TYPE "health_profile_ai_section" ADD VALUE 'HABITS';
|
|
ALTER TYPE "health_profile_ai_section" ADD VALUE 'GOALS';
|
|
|
|
-- AlterEnum
|
|
ALTER TYPE "assessment_instrument" ADD VALUE 'AUDIT_C';
|
|
|
|
-- AlterTable
|
|
ALTER TABLE "user_health_profiles" ADD COLUMN "life_confirmed_json" JSONB;
|