I want to implement soft delete in explicit many to many relation using prisma. I want to somehow disconnect the link betweeen them and mark both user and all its memories as deleted true.
is it a good approach ? or how to do this in genral
My Prisma Schema looks like this:
model User {
userId String @id @default(uuid())
memories UserMemory[]
deleted Boolean @default(false)
}
model Memory {
memoryId String @id @default(uuid())
users UserMemory[]
deleted Boolean @default(false)
}
model UserMemory {
userId String
user User? @relation(fields: [userId], references: [userId])
memoryId String
memory Memory? @relation(fields: [memoryId], references: [memoryId])
@@id([userId, memoryId])