-
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
Mapping discrepancy for ManyToOne with new inference #8805
Comments
There also seems to have an error in the inference of the nullable attribute for simple types. I have updated my reproduction to insert a typed nullable string attribute, that generates a VARCHAR NOT NULL in my Doctrine schema. |
Finding who introduced the new inference and it which PR would help finding the best people to help with this `git log -S 'some string' should help with this. |
Nullable inference was backed out in #8732 due to B/C issues. |
Ah, thanks to both of you. I had tried to look for similar issues but did not come across these ones. Too bad it has been reversed, but I understand the BC point of view. I'll wait for the 3.x to remove these last bits of redundant annotations! Cheers! |
Hello,
I've come across a discrepancy in the SQL produced by Doctrine for ManyToOne annotations. As stated in the official documentation, the
JoinColumn
should infer thenullable
from the attribute type definition.However, this is actually not the case.
I've created a minimal reproduction case in this repository.
As you can see in EntityC, I've defined one
ManyToOne
with PHP7.4 typed attributes and the other without it.In the dump of my SQL schema, you can see that the SQL statements for both fields are not the same, when they should normally be.
The statement for the relationship with EntityA, defined with a typed attribute, has a
DEFAULT NULL
clause that should not happen.How can I help going ahead in fixing this?
The text was updated successfully, but these errors were encountered: