npm update and fix delete publisher constraint issue

This commit is contained in:
Dobromir Popov
2024-09-12 02:48:06 +03:00
parent e4ba51b42d
commit d835b239f5
4 changed files with 214 additions and 242 deletions

View File

@ -275,7 +275,7 @@ model Survey {
model Message {
id Int @id @default(autoincrement())
publisher Publisher @relation(fields: [publisherId], references: [id])
publisher Publisher @relation(fields: [publisherId], references: [id], onDelete: Cascade)
publisherId String
date DateTime
content String @db.Text
@ -305,7 +305,7 @@ model EventLog {
id Int @id @default(autoincrement())
date DateTime
publisherId String?
publisher Publisher? @relation(fields: [publisherId], references: [id])
publisher Publisher? @relation(fields: [publisherId], references: [id], onDelete: SetNull)
shiftId Int?
shift Shift? @relation(fields: [shiftId], references: [id])
content String @db.VarChar(5000)