Update schema.prisma

Took 24 minutes
This commit is contained in:
Lucàs
2023-03-27 11:46:42 +02:00
parent bdcb49a16c
commit 4eacbd913d
+10 -2
View File
@@ -22,8 +22,7 @@ model User {
gender Gender @default(UNKNOWN)
role Role @default(USER)
createdAt DateTime @default(now())
updatedAt DateTime @default(now())
lastConnexion DateTime @default(now())
updatedAt DateTime @updatedAt
// Liste des chats de l'utilisateur
ChatID String[] @db.ObjectId
@@ -53,12 +52,17 @@ model User {
model Notification {
id String @id @default(auto()) @map("_id") @db.ObjectId
type NotificationType
createdAt DateTime @default(now())
hasBeenConsulted Boolean @default(false)
UserId String @db.ObjectId
User User @relation(fields: [UserId], references: [id])
}
model Match {
id String @id @default(auto()) @map("_id") @db.ObjectId
createdAt DateTime @default(now())
UserId String[] @db.ObjectId
User User[] @relation(fields: [UserId], references: [id])
}
@@ -66,6 +70,8 @@ model Match {
model Passion {
id String @id @default(auto()) @map("_id") @db.ObjectId
name String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
// Les utilisateurs qui on en commun cette passion
UserId String[] @db.ObjectId
@@ -75,6 +81,7 @@ model Passion {
model Chat {
id String @id @default(auto()) @map("_id") @db.ObjectId
messages Message[]
createdAt DateTime @default(now())
// Les utilisateurs qui ont un chat en commun
User User[] @relation(fields: [UserId], references: [id])
@@ -85,6 +92,7 @@ model Message {
id String @id @default(auto()) @map("_id") @db.ObjectId
message String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
// L'utilisateur qui a envoyé le message
UserID String @db.ObjectId