Maintain data integrity with collection relationships #6419
Unanswered
estebanarriaga
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everybody!
Relations can be broken very easily when deleting an entry that is being used through a relation in another entry.
Lets say I have a
product
collection with a relationship tomedia
collection.Payload allows by default the deletion of an entry
media
related to a product witch then breaks theproduct
entry with that relation.This is a way I of avoiding the deletion via the
beforeChange
hook (but I find it unscalable when having many relations):Is there a better way to avoid deletion of an entry if is being used other than checking with the
beforeChange
hook?Most CMS wont let you delete an entry being used, but Payload doesn't have this feature. Is it on purpose?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions