« Previous | Next » 

Revision a0d2d061

Parent 90d8044d
Child 38b83614

Added by Alexander Berl over 7 years ago

[!!!][BUGFIX] Make bidirectional OneToOne relations work correctly

This change fixes bidirectional OneToOne relations, which previously
resulted in foreign keys being created on both sides. Therefore the
related entities could no longer be deleted.

The problem was that the joinColum mapping was created in every case,
which doctrine interprets as a secondary hint for the owning side.
The joinColumn should only be created for the owning side, i.e. only
for unidirectional OneToOne and for the inversedBy side of a
bidirectional OneToOne.

This change is not breaking, but needs manual attention to fix the
schema of own projects as follows:

After upgrading to this change, you should run following commands
from command line to update your projects:

flow doctrine:migrationgenerate
-> check the created migration file, it should contain a number of
"DROP FOREIGN KEY", "DROP INDEX" and "DROP {column}" statements
for each of your bidirectional OneToOne relations.
flow doctrine:migrate
-> applies the changes

Fixes: FLOW-87
Releases: master, 3.0, 2.3, 2.2
Change-Id: Iba0846328486c8816bcf25aa338cd78e3d0055d8

  • added
  • modified
  • copied
  • renamed
  • deleted