mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 12:32:43 +00:00
REFERRAL joins the document-kind enum (Überweisung — LOINC 57133-1 / ePA ANF). inbound_documents gains content_sha256 (plaintext hash for same-user duplicate detection; pre-existing rows stay NULL) and content_codec (base64v1 legacy string codec | binary2 binary codec, explicit column — never header-sniffed), plus a partial unique index that allows at most one LIVE row per (user_id, content_sha256) so a tombstoned document never blocks a re-upload. document_condition_links is the m:n join between a document and an illness/condition episode (a discharge letter legitimately touches two conditions); both sides cascade. app_settings carries the two admin-tunable limits (per-file cap, default 25 MiB; per-user quota, default 1 GiB) and users the nullable per-user quota override. Task: W1-T1.