mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
#[JoinColumn] changes nullability of a relation #6713
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Nemo64 on GitHub (May 10, 2021).
I'm still experimenting with the 2.9.x branch (
6753b26) and noticed a strange schema difference.These 2 definitions create a different schema. The
JoinColumndefinition creates aNOT NULLcolumn definition while the slimmer schema isDEFAULT NULL.I also tested it with a
2.8.4and there I have to explicitly use@JoinColumn(nullable=false)to make that column not nullable. The pure presence of the annotation does not change the schema.I think that's not intended.
@beberlei commented on GitHub (May 10, 2021):
Yes this is already known, see #8678 please if that works for you.
@Nemo64 commented on GitHub (May 14, 2021):
I tested the new version and I still have strange behavior.
What I would expect:
nullable, that should overrule everything else. There are some circular situations where it is necessary to have the relation nullable.