Documentation regarding the default value of the nullable attribute for JoinColumn is out of sync #7464

Closed
opened 2026-01-22 15:52:01 +01:00 by admin · 1 comment
Owner

Originally created by @pawel-slowik on GitHub (Jan 21, 2025).

https://www.doctrine-project.org/projects/doctrine-orm/en/3.3/reference/association-mapping.html#mapping-defaults
https://www.doctrine-project.org/projects/doctrine-orm/en/2.20/reference/association-mapping.html#mapping-defaults

This:

Also nullable attribute on JoinColumn will be inherited from PHP type.

is not true. The change that enabled nullability inference was reversed: https://github.com/doctrine/orm/pull/8732.

The Annotations Reference chapter in the documentation was updated to reflect the reversal: https://github.com/doctrine/orm/pull/8732/files#diff-73ee81fc89428c88759f9c8cda822ecee129f4deebb9c317f82281d5fae4a74c.
But the Association Mapping chapter was not, probably because the changes there were rolled together as a part of a larger update: b3ed525d4d.

Users who follow the advice of relaying on the defaults and leaving out JoinColumn specification will end up with unexpectedly nullable columns (unless they review DDL statements carefully).

Originally created by @pawel-slowik on GitHub (Jan 21, 2025). https://www.doctrine-project.org/projects/doctrine-orm/en/3.3/reference/association-mapping.html#mapping-defaults https://www.doctrine-project.org/projects/doctrine-orm/en/2.20/reference/association-mapping.html#mapping-defaults This: > Also nullable attribute on JoinColumn will be inherited from PHP type. is not true. The change that enabled nullability inference was reversed: https://github.com/doctrine/orm/pull/8732. The __Annotations Reference__ chapter in the documentation was updated to reflect the reversal: https://github.com/doctrine/orm/pull/8732/files#diff-73ee81fc89428c88759f9c8cda822ecee129f4deebb9c317f82281d5fae4a74c. But the __Association Mapping__ chapter was not, probably because the changes there were rolled together as a part of a larger update: https://github.com/doctrine/orm/commit/b3ed525d4db2f8c3ebe3cda2d7f2e4ef686cfcbf. Users who follow the advice of relaying on the defaults and leaving out JoinColumn specification will end up with unexpectedly nullable columns (unless they review DDL statements carefully).
admin closed this issue 2026-01-22 15:52:01 +01:00
Author
Owner

@pawel-slowik commented on GitHub (Feb 19, 2025):

The documentation fix #11798 has been merged into all branches, so I'm closing this as completed.

@pawel-slowik commented on GitHub (Feb 19, 2025): The documentation fix #11798 has been merged into all branches, so I'm closing this as completed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#7464