feat(01-21): add guarded Google sync progress

- persist one bounded owner-scoped current-run envelope
- reject stale writers and materialize interrupted runs safely
This commit is contained in:
Marc-André Bombeck committed 2026-07-29 14:49:12 +02:00
1 parent addd6b7000
commit 5cfcb69ef2
3 files changed
+320

No files matched your search

@@ -0,0 +1,2 @@
ALTER TABLE "google_health_connections"
ADD COLUMN "sync_progress" JSONB;
+3
View File
@@ -3857,6 +3857,9 @@ model GoogleHealthConnection {
/// pre-fix externalId (a re-scored night minted parallel copies). Null =
/// repair pending (or the connection predates the fix).
sleepRepairedAt DateTime? @map("sleep_repaired_at")
/// One bounded, owner-scoped current sync run. This is replaced at the start
/// of every run and never retains provider payloads or historical runs.
syncProgress Json? @map("sync_progress")
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")