diff --git a/prisma/migrations/0163_v1171_onboarding_goals/migration.sql b/prisma/migrations/0163_v1171_onboarding_goals/migration.sql new file mode 100644 index 000000000..2eba45587 --- /dev/null +++ b/prisma/migrations/0163_v1171_onboarding_goals/migration.sql @@ -0,0 +1,15 @@ +-- v1.17.1 — persist the onboarding goal selection. +-- +-- The GoalsChipPicker step let the user toggle goal slugs, but both +-- Skip and Next discarded the selection — the picker was decorative. +-- This adds the `onboarding_goals` text array the dead code already +-- referenced, so the selection can seed dashboard tile pinning and +-- reminder suggestions. +-- +-- Purely-additive: one new column on `users`, NOT NULL with a `'{}'` +-- (empty array) default, so every existing row keeps "no preference" +-- without a backfill pass. The column is a personalization seed, not a +-- clinical target store. + +ALTER TABLE "users" + ADD COLUMN "onboarding_goals" TEXT[] NOT NULL DEFAULT ARRAY[]::TEXT[]; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 715611d14..7ca1c51e8 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -236,6 +236,15 @@ model User { // round-trip — the column stays at 4 for completed users) // Null = legacy pre-W14b user; the wizard treats null as 0 on mount. onboardingStep Int @default(0) @map("onboarding_step") + // v1.17.1 — goal slugs chosen during onboarding (GoalsChipPicker). + // Seeds dashboard tile pinning + reminder suggestions; NOT a clinical + // target store (targets are fully derived from height/age/gender + + // clinical refs in /api/insights/targets). Empty [] = skipped / no + // preference. The slug set is the closed enum + // `ONBOARDING_GOAL_SLUGS` in src/lib/onboarding/goals.ts; a String[] + // (not a relation) mirrors `insightsExcludeMetrics` precedent — the + // set is small and fixed, never queried relationally. + onboardingGoals String[] @default([]) @map("onboarding_goals") // v1.4.15 Phase B5: tracks whether the user has finished (or // explicitly dismissed) the spotlight tour that overlays the // dashboard on first arrival. Distinct from the wizard at