Files
HealthLog/prisma/migrations/0173_v1186_tour_progress/migration.sql
T
Marc-André Bombeck 59e7b33285 feat(onboarding): add resumable module-tour progress field + API
Add nullable onboarding_tour_progress_json to users (migration 0173),
a Zod-validated progress shape, and extend POST /api/onboarding/tour to
accept a mid-tour resume checkpoint and clear it on replay. Surface the
resume point on GET /api/auth/me and register the contract in OpenAPI so
the native client mirrors it.
2026-06-18 19:27:28 +02:00

23 lines
1010 B
SQL

-- v1.18.6 — resumable module-tour progress.
--
-- A single nullable JSONB column on `users` carrying the fine-grained
-- resume point for the module-by-module guided tour. Follows the
-- established per-user JSON-column convention (`dashboard_widgets_json`,
-- `insights_layout_json`, `coach_prefs_json`).
--
-- Shape (validated by `src/lib/onboarding/tour-progress.ts`):
-- { "lastStopId": string | null,
-- "completedStopIds": string[],
-- "status": "in_progress" | "completed" | "skipped",
-- "updatedAt": string (ISO 8601) }
--
-- NULL = the user has not started the module tour. The coarse
-- `onboarding_tour_completed` boolean stays the launcher's auto-launch
-- gate; this column is purely the resume point and is cleared back to
-- NULL on a Settings replay so the tour genuinely restarts.
--
-- Additive + nullable: every existing account keeps NULL and the
-- application resolver treats NULL as "not started".
ALTER TABLE "users" ADD COLUMN "onboarding_tour_progress_json" JSONB;