dhatGuy
04/19/2022, 4:04 PMmodel User {
id String @id @default(uuid()) /// @zod.uuid({ message: "Invalid UUID" })
name String
email String @unique /// @zod.email({ message: "Invalid email address" })
username String @unique /// @zod.min(3)
phone String? /// @zod.min(10).max(12)
passwordHash String
emailVerified Boolean @default(false)
acceptedTermsOfUse Boolean @default(false)
points Points[]
wish String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Points {
id Int @id @default(autoincrement()) /// @zod.int({ message: "Invalid UUID" })
userId String
User User @relation(fields: [userId], references: [id])
points Int @default(0)
totalAfter Int @default(0)
desc String
action PointsAction
createdAt DateTime @default(now())
}
How do I store the total of points in the user table, please?Austin Zentz
04/19/2022, 5:26 PMWil Moore III
04/19/2022, 8:07 PMdhatGuy
04/19/2022, 8:41 PMdhatGuy
04/19/2022, 8:44 PMWil Moore III
04/19/2022, 8:46 PM