-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disallow orphan removal attribute on many-to-one #6772
Disallow orphan removal attribute on many-to-one #6772
Conversation
It only makes sense for collections, and there is no collection here. Plus the docs do not say it is supported. See http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/working-with-associations.html#orphan-removal
@greg0ire please write a test verifying that it DOESN'T work |
@Ocramius just to be sure, you want me to create an XML mapping with that attribute and test that it doesn't validate against the XSD? |
It might be my lazyness speaking, but I don't see the point of this test:
|
If you mean I should test that the expected behavior does not work, the expected behavior is not defined. |
@greg0ire no, I'd want a test that verifies that the orphan removal doesn't kick in :-) |
So:
|
How should one write a test for this? With a many-to-one there is no collection to manipulate and subsequently trigger this behavior. |
The set of 'things that don't happen' is quite large, surely? |
Yes it is, but that's also because the "set of things we don't know to be
happening" is almost equally big.
On 13 Oct 2017 17:41, "Ciaran McNulty" <[email protected]> wrote:
The set of 'things that don't happen' is quite large, surely?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#6772 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAJakF43Aw4motTFP4UAAIqrOyWkn2Zkks5sr4SWgaJpZM4P4lr9>
.
|
Working on it. |
8cf9448
to
c7522a3
Compare
170046a
to
72c2d91
Compare
And it only passes with sqlite but not database that ensure integrity. What do I do now @Ocramius ? setup a null cascade? Or do I remove this commit now that we have proof? |
I went ahead and setup a set null cascade, now the test pass with mysql, but not pg:
How do I do this: https://stackoverflow.com/questions/12505158/generating-a-uuid-in-postgres-for-insert-statement#12505220 ? EDIT: let's just not do it and set uuids manually |
a137d7d
to
2a86517
Compare
I moved the proof to #6774 so that you can decide whether to merge both or just this one more easily, and in the order you see fit. |
It only makes sense for collections, and there is no collection here.
Plus the docs do not say it is supported.
See
http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/working-with-associations.html#orphan-removal