sdy

update prisma schema

......@@ -28,6 +28,7 @@ model Room {
id Int @default(autoincrement()) @id
participants User[] @relation(references: [id])
categories Category[] @relation(references: [id])
Message Message[]
}
model Category {
......@@ -39,8 +40,10 @@ model Category {
model Message {
id Int @default(autoincrement()) @id
text String? @default("")
from User[] @relation("Sender", references: [id])
to User[] @relation("Receiver", references: [id])
from User @relation("Sender", fields: [fromId], references: [id])
fromId Int
to User? @relation("Receiver", fields: [toId], references: [id])
toId Int?
room Room @relation(fields: [roomId], references: [id])
roomId Int
createdAt DateTime? @default(now())
......