You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PrismaClient.<model>.delete allow passing select or include field via <Model>DeleteArgs, but it won't actually do the cascading deletion, and will raise change you are trying to make would violate the required relation if the relation is required.
Suggested solution
Since it allows the parameter, maybe it is good to make use of it.
The suggestion is that it should delete the included posts as well, and, if the relation is required by posts, it should be allowed since it is not violating the requirement.
Alternatives
Currently it can be done by sth. like transaction([deleteMany(...), delete(...)]), or on delete cascade with an optional-but-actually-required relation.
The text was updated successfully, but these errors were encountered:
@pantharshit00 It is actually more like an option for cascade deletion without on delete cascade. This will offer an option to cascade when the underlying schema is on delete set null.
Problem
PrismaClient.<model>.delete
allow passingselect
orinclude
field via<Model>DeleteArgs
, but it won't actually do the cascading deletion, and will raisechange you are trying to make would violate the required relation
if the relation is required.Suggested solution
Since it allows the parameter, maybe it is good to make use of it.
If sth. like
The suggestion is that it should delete the included
posts
as well, and, if the relation is required byposts
, it should be allowed since it is not violating the requirement.Alternatives
Currently it can be done by sth. like
transaction([deleteMany(...), delete(...)])
, oron delete cascade
with an optional-but-actually-required relation.The text was updated successfully, but these errors were encountered: