Respect many-to-many inverse onDelete=cascade #7293

Open
opened 2026-01-22 15:49:22 +01:00 by admin · 0 comments
Owner

Originally created by @jdelaune on GitHub (Jan 3, 2024).

Feature Request

Q A
New Feature yes

Summary

Reading the documentation here: https://www.doctrine-project.org/projects/doctrine-orm/en/2.17/reference/working-with-objects.html#join-table-management-when-removing-from-many-to-many-collections

It seems the lookup on the JoinColumn for the onDelete="CASCADE" property is only done on the owning side of the many-to-many. It would be nice to get this working on the inverse side as well by looking it up via the InverseJoinColumn attribute. Means we can save an extra query and let the database do the cascade. Not sure how possible this is as the attribute lives on the owning target class.

Originally created by @jdelaune on GitHub (Jan 3, 2024). ### Feature Request | Q | A |------------ | ------ | New Feature | yes #### Summary Reading the documentation here: https://www.doctrine-project.org/projects/doctrine-orm/en/2.17/reference/working-with-objects.html#join-table-management-when-removing-from-many-to-many-collections It seems the lookup on the `JoinColumn` for the `onDelete="CASCADE"` property is only done on the owning side of the many-to-many. It would be nice to get this working on the inverse side as well by looking it up via the `InverseJoinColumn` attribute. Means we can save an extra query and let the database do the cascade. Not sure how possible this is as the attribute lives on the owning target class.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#7293