Answer the question
In order to leave comments, you need to log in
Why aren't the pinned posts in the post removed when I cascade delete?
Good time.
The other day there was a dilemma with cascading deletion. I can’t figure out how to build a database so that when a certain table entry is deleted, using a cascade delete, the records attached to it are deleted.
Implementation #1
Implementation #2
Further on the attached files
, the
Card should have only one Word, but when the Card is deleted, the Word object should also be deleted.
At the moment, I solved this problem through triggers. But when deleting a Pack with cards, the words that are assigned to a particular card should also be deleted.
Answer the question
In order to leave comments, you need to log in
Firstly, the specified links do not have permissions to view.
Secondly, implementation on own triggers is no worse than cascade deletion. And even better. Such cascading operations are performed by system triggers. And before doing something, they must correctly understand the written condition. And this takes time. So your trigger will be faster than any system trigger.
Well, if you still decide to deal with cascades, check the syntax. There might be an error somewhere. Experiment with the new test patterns. Find the differences.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question