onDelete and onUpdateIntegrity in ManyToMany relations
Is your feature request related to a problem? Please describe.
I have an Attachment entity that can be related to many other entities; if an Attachment is "used" by someone else, it cannot be deleted. ManyToOne relations support the onDelete: 'no action' FK constraint, but ManyToMany no.
Describe the solution you'd like
Add the support for onDelete and onUpdateIntegrity in ManyToMany relations
Describe alternatives you've considered Manual check of every relation before deleting an Attachment.
Additional context I'm using MySQL with mikro-orm 4.5 because I have some problem upgrading di version 5 (see https://github.com/mikro-orm/mikro-orm/issues/2130 and I must try again now with the stable version)
Add the support for onDelete and onUpdateIntegrity in ManyToOne relations
Here and in the title you say you want to add it to m:1? But that is where it already is, right?
Note that for M:N pivot tables we never do update queries, so there is no reason for onUpdateIntegrity.
Sorry, my fault, wrong title ant then I copy&pasted.
Regarding onUpdateIntegrity, I'm sure the ORM don't do it, but I think is legit to update a primary key (altough not the best practice, I know). But I agree, it could be avoided. The check on deletions is another thing, IMHO.
Closing as this is nowadays possible by defining a pivot entity explicitly.