diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 39b64ef15..b27ad21fe 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -421,6 +421,16 @@ model Workout { /// Ingest dedup. NULL externalId is distinct so two manual /// entries on the same day never collide here. + /// + /// TODO(v1.5 iOS): cross-source workout dedup. The current key is + /// (userId, source, externalId) — so the SAME workout ingested from + /// MANUAL plus the iOS HealthKit passthrough lands two rows because + /// `source` differs. Measurements already solved this via + /// `pickCanonicalSourceRows()` (the read-time canonical-source + /// picker in src/lib/analytics/source-priority.ts); workouts need + /// the symmetric helper before the dashboard "recent workouts" tile + /// can show one row per workout instead of one per source. Tracked + /// for v1.5 P1 alongside the iOS app. @@unique([userId, source, externalId]) /// Dashboard "recent workouts" query path. @@index([userId, startedAt])