-
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
Impossible to have part of a composite key to be null in a ternary relationship ? #6647
Comments
@CPASimUSante Doctrine ORM does not allow nor support From the MySQL docs, for example:
In other engines, a primary key with nullable fields would also make no sense, because Closing as |
Thank you for your confirmation/explanation. I'll use the "regular" entity system with primary key then. |
Not to reopen, but as a side note, NULL can not indeed be compared to a value, but it can be checked : null or not null, which does 2 states => values possible. But i understand it would be a different kind of check... |
The DB doesn't check it with the uniqueness of a |
I have an entity that holds relation with 3 entities Session, User and Institution.
but when i try to generate the schema, i have :
the three part of the key have NOT NULL even if i add explicitly nullable=true...
i've validated the schema with a app/console doctrine:schema:validate and it's OK
I've read the doc for ID annotation
and
those for join column with nullable
Finally , I'm not sure to understand the implication of "General Considerations" part for the composite keys in the doc
It seems wrong to have to change a "regular" ternary relationship for a classical Entity with onr Primary key and userId, sessionId, institutionId as foreign keys, which can be null.
Why can't a keys like (userIdValue, null, institutionIdValue), (userIdValue, sessionId, institutionIdValue), (null, null, institutionIdValue)... as long as the composite key stay unique
Did i miss something in the doc, is it a limitation or is is a real bug ?
Thank you
The text was updated successfully, but these errors were encountered: