Soft Delete: Dealing With Unique Constraint in Real-World Case
· 3 min read
I introduced how to achieve soft delete in ZenStack in the previous post below:
Soft delete: Implementation issues in Prisma and solution in ZenStack
The solution appears quite elegant with the help of the access policy in the schema.
model Post {
...
deleted Boolean @default(false) @omit
@@deny(‘read’, deleted)
...
}