Files
HealthLog/prisma/migrations/0176_v1186_coach_last_seen/migration.sql
T
Marc-André Bombeck c941ab24f4 fix(migrations): renumber coach last-seen migration to 0176
The disclaimer-preference migration already claims 0175 in this release;
move the coach last-seen stamp to 0176 so both apply uniquely and in
order.
2026-06-18 22:05:17 +02:00

16 lines
733 B
SQL

-- v1.18.6 (CCH-03) — Coach "last seen" stamp for the FAB unread dot.
--
-- A single nullable timestamp on `users`. The proactive Coach nudge now
-- lands as an ASSISTANT message in the conversation rail (CCH-02); the
-- Coach FAB shows a discreet unread dot when the newest Coach message is
-- newer than this stamp, and clears it once the user opens the Coach
-- (the open writes the current time here via POST
-- /api/insights/coach/seen).
--
-- NULL backfills every existing row to "never opened" — harmless: the
-- dot only paints when an actual newer Coach message exists, so a user
-- with no proactive nudge yet sees nothing. No data migration needed.
ALTER TABLE "users"
ADD COLUMN "coach_last_seen_at" TIMESTAMP(3);