G
G
grabbee2020-11-16 13:31:06
Doctrine ORM
grabbee, 2020-11-16 13:31:06

Is it worth creating double bonds on all dependent entities?

For example, the User entity. It can leave different activities, such as Photo Likes. And we then have a link from Like to User. When deleting a User, it is correct to delete all his likes (all other activity). For this, it is convenient to use cascade deletion and orphan deletion. In this case, we need a one-to-many relationship from User to Likes.

And there are already more than a dozen such additional entities. It is unlikely that I will use these links from the User, except for cascading removal by means of doctrine.

Is this the correct approach? Do two-way links just to be able to cascade delete all Account records while deleting the Account itself?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question