feat(mood): add the MoodContext sub-row and its encrypted note

- migration 0311 creates mood_contexts, keyed by the entry, cascading from
  both the entry and the owner
- work, contacts, leisure and one notable event; every field nullable, and an
  entry with nothing filled in gets no row at all
- notes_encrypted registered in ENCRYPTED_COLUMNS and in the rotation script,
  so a key rotation cannot strand it
This commit is contained in:
Marc-André Bombeck committed 2026-08-08 06:51:42 +02:00
1 parent 2f68b3dc79
commit 7a4ee19c68
4 files changed
+200

No files matched your search

+11
View File
@@ -479,6 +479,17 @@ async function main() {
prisma.measurement,
),
);
// v1.38 — the day-context note on a mood entry. Its own table, so its own
// walk; a context row exists only where somebody added one, and a row with
// no note carries NULL here and is skipped like every other nullable Bytes
// column.
results.push(
await rotateBytesColumn(
"MoodContext",
"notesEncrypted",
prisma.moodContext,
),
);
// ───── v1.25 medication free-text notes (Bytes columns) ─────
// "notesEncrypted" (MedicationSideEffect + MedicationInventoryItem) +