sdy

update prisma schema

......@@ -20,6 +20,8 @@ model User {
bio String? @default("")
rooms Room[] @relation(references: [id])
messages Message[]
sender Message @relation("Sender")
receiver Message[] @relation("Receiver")
createdAt DateTime? @default(now())
}
......@@ -38,6 +40,12 @@ model Category {
model Message {
id Int @default(autoincrement()) @id
text String? @default("")
sender User @relation(fields: [senderId], references: [id])
senderId Int
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?
userId Int?
}
\ No newline at end of file
......