-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.prisma
39 lines (35 loc) · 1008 Bytes
/
schema.prisma
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
binaryTargets = "native"
}
enum Role {
USER
ADMIN
}
// Define your own datamodels here and run `yarn redwood prisma migrate dev`
// to create migrations for them and apply to your dev DB.
// TODO: Please remove the following example:
model User {
id Int @id @default(autoincrement())
caloriesLimit Int @default(2100)
email String @unique
name String
roles Role @default(USER)
hashedPassword String
salt String
resetToken String?
resetTokenExpiresAt DateTime?
FoodEntry FoodEntry[]
}
model FoodEntry {
id Int @id @default(autoincrement())
user User @relation(fields: [userId], references: [id])
userId Int
name String
calories Int
dateTaken DateTime? @default(now())
}