mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-09 13:01:00 +00:00
Two additive measurement_type values for the Oura coverage completion:
- SLEEP_SCORE — the headline 0-100 sleep-quality score (unit score),
kept apart from the WHOOP sleep sub-scores so two vendors' headline
numbers never share a bucket.
- BODY_TEMPERATURE_DEVIATION — a signed nightly body-temperature offset
from the personal baseline (celsius). It is a deviation, not an
absolute reading, so it cannot share the body / skin / wrist
temperature buckets.
Migration 0165 extends the enum (additive, no backfill). Register both in
the validation enum, units, plausibility ranges, category overlay, list-UI
label/icon/colour maps, chart-token allowlist, and the PR-direction switch
(both resolve to no record direction). Both are descriptive signals, not
clinical vitals, so they stay out of the doctor-report PDF. Localise the
two list labels across all six locales and regenerate the OpenAPI contract.
21 lines
1.2 KiB
SQL
21 lines
1.2 KiB
SQL
-- v1.17.1 — Oura coverage completion (additive).
|
||
--
|
||
-- Two new `measurement_type` enum values so the Oura sync can store signals it
|
||
-- already fetches (or now fetches) but had no home for:
|
||
--
|
||
-- 1. `SLEEP_SCORE` — Oura's headline 0–100 Sleep Score from the
|
||
-- `daily_sleep` collection (distinct from the per-stage `sleep` detail).
|
||
-- Kept apart from the WHOOP `SLEEP_PERFORMANCE` / `SLEEP_EFFICIENCY`
|
||
-- sub-scores so two vendors' headline numbers never share a bucket.
|
||
-- 2. `BODY_TEMPERATURE_DEVIATION` — Oura's nightly body-temperature deviation
|
||
-- from the user's personal baseline (`daily_readiness.temperature_deviation`),
|
||
-- a SIGNED °C offset (illness / luteal-phase / stress signal). It is NOT an
|
||
-- absolute reading, so it cannot share the BODY_TEMPERATURE /
|
||
-- SKIN_TEMPERATURE / WRIST_TEMPERATURE absolute-temperature buckets.
|
||
--
|
||
-- Purely-additive: two enum extensions, no backfill, no existing row touched,
|
||
-- no new tables or columns. Both stored as `source = OURA`.
|
||
|
||
ALTER TYPE "measurement_type" ADD VALUE IF NOT EXISTS 'SLEEP_SCORE';
|
||
ALTER TYPE "measurement_type" ADD VALUE IF NOT EXISTS 'BODY_TEMPERATURE_DEVIATION';
|