mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Respect many-to-many inverse onDelete=cascade #7293
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jdelaune on GitHub (Jan 3, 2024).
Feature Request
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
JoinColumnfor theonDelete="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 theInverseJoinColumnattribute. 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.