mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 12:32:43 +00:00
Adds the per-device APNs identity pair (`apnsToken` + `apnsEnvironment`) to the Device model so the dispatcher can fan a notification out to a user's iPhone via Apple's push gateway. The iOS client decides whether the token belongs to the sandbox or production gateway at registration time — the server never auto-detects, mirroring the W1 stream-2 recommendation. Migration 0037 is strictly additive: both columns nullable, a CHECK constraint pairs them so neither can be set without the other, and a single-column index on `apns_token` backs the dispatcher's per-user lookup plus the cross-user-hijack guard already enforced in `POST /api/devices`. The `NotificationChannel.type` column stays a free-form string — adding "APNS" as the fourth channel-type is a TypeScript-side change in the next commit. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>