mirror of
https://github.com/LucasVbr/meeting-app.git
synced 2026-07-09 06:58:06 +00:00
Schema User / Chat
This commit is contained in:
+14
-1
@@ -11,4 +11,17 @@ model User {
|
|||||||
id String @id @default(auto()) @map("_id") @db.ObjectId
|
id String @id @default(auto()) @map("_id") @db.ObjectId
|
||||||
email String @unique
|
email String @unique
|
||||||
password String?
|
password String?
|
||||||
}
|
|
||||||
|
messageSent Chat[]
|
||||||
|
messageReceived Chat[] @relation("chatReceived")
|
||||||
|
}
|
||||||
|
|
||||||
|
model Chat {
|
||||||
|
id String @id @default(auto()) @map("_id") @db.ObjectId
|
||||||
|
message String
|
||||||
|
sender User? @relation(fields: [senderId], references: [id])
|
||||||
|
senderId String @db.ObjectId
|
||||||
|
receiver User? @relation(name:"chatReceived", fields: [receiverId], references: [id])
|
||||||
|
receiverId String @db.ObjectId
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user