eletrotupi / tcc/ commit / 491dca7

api/auth: add the onboarding and terms columns

An activated account now needs somewhere to record that it saw the
first-run walkthrough and which terms it agreed to. The columns are
nullable, so existing rows stay valid and read as not yet done
Pedro Lucas Porcellis porcellis@eletrotupi.com · 11 days ago 491dca79fa09cef036acd73efc346039c3d1140d Browse files
Parents fb784c6
Changed files
2
Additions
+8
Deletions
0
/dev/null → api/prisma/migrations/20261016203936_add_onboarding_and_terms_fields/migration.sql
1 +
-- AlterTable
2 +
ALTER TABLE "users" ADD COLUMN     "onboarding_seen_at" TIMESTAMP(3),
3 +
ADD COLUMN     "terms_accepted_at" TIMESTAMP(3),
4 +
ADD COLUMN     "terms_version" TEXT;
api/prisma/schema.prisma
1 1
generator client {
2 2
  provider = "prisma-client-js"
3 3
  //output   = "../src/generated/prisma"
4 4
}
5 5

26 26

27 27
  pushToken            String?  @map("push_token")
28 28
  notificationsEnabled Boolean  @default(true) @map("notifications_enabled")
29 29
  dailyReminderTime    String?  @map("daily_reminder_time")
30 30

31 +
  onboardingSeenAt DateTime? @map("onboarding_seen_at")
32 +
  termsAcceptedAt  DateTime? @map("terms_accepted_at")
33 +
  termsVersion     String?   @map("terms_version")
34 +

31 35
  moods            Mood[]
32 36
  triggers         Trigger[]
33 37
  sleepRecords     SleepRecord[]
34 38
  insights         Insight[]
35 39
  medicineRegimens MedicineRegimen[]
301 305
  THREE_TIMES_DAILY
302 306
  WEEKLY
303 307
  BIWEEKLY
304 308
  MONTHLY
305 309
}