-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.prisma.example
49 lines (44 loc) · 1.37 KB
/
schema.prisma.example
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
40
41
42
43
44
45
46
47
48
49
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
}
model User {
id Int @id @default(autoincrement())
email String @unique
notifications Notification[]
}
model Notification {
id Int @id @default(autoincrement())
user User @relation(fields: [userId], references: [id])
userId Int
notificationType NotificationType
title String?
bodyTemplate String
contextName String
contextParameters Json @default("{}")
sendAfter DateTime?
subjectTemplate String?
status NotificationStatus @default(PENDING_SEND)
contextUsed Json?
adapterUsed String?
sentAt DateTime?
readAt DateTime?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
enum NotificationType {
EMAIL
PUSH
SMS
IN_APP
}
enum NotificationStatus {
PENDING_SEND
SENT
FAILED
READ
CANCELLED
}