mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-1799: Doctrine's Reverse Engineering 1-n (one to many) association misunderstood as 1-1 (one to one) #2267
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 @doctrinebot on GitHub (Apr 27, 2012).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user linuxatico:
I found an odd behaviour of Doctrine's reverse engineering process, just create two simple tables tied by a simple 1-n relationship, take a look at the snap of the folowing SQL code:
I have a Symfony2 netbeans project at
and from that location, according to
in a terminal I did:
The fact is that it only seems ok, because if you take a look at "Tag.orm.yml":
It created a **oneToOne* relationship and not a oneToMany* !
If you need any more confirmation, here are _Task.php_ and _Tag.php_:
_Task.php_
linuxatico
@doctrinebot commented on GitHub (Apr 30, 2012):
Comment created by linuxatico:
This problem is encountered only in this case, 1-1 and n-m relationship are handled in the right way, has anyone else faced this problem too?
linuxatico
@doctrinebot commented on GitHub (May 7, 2012):
Comment created by linuxatico:
Hi all,
I wanna give the Doctrine community my full support to help fixing this bug, but I need someone who can give me an answer.....
I couldn't figure out in the source code which is the method executed when given the command
$ ./../../bin/php/php5.3.6/bin/php app/console doctrine:mapping:convert yml ./src/Acme/TaskBundle/Resources/config/doctrine/ --from-database --forceI will keep on looking for it, but some help will be appreciated,
linuxatico
@doctrinebot commented on GitHub (May 7, 2012):
Comment created by linuxatico:
Found in vendor/doctrine/lib/Doctrine/ORM/Tools/Console/Command/ConvertMappingCommand.php
I'll see what I can do.
linuxatico
@doctrinebot commented on GitHub (May 9, 2012):
Comment created by linuxatico:
Even if I keep being ignored, I want to report a very useful discovery about this annoying bug: it's 100% related to the YAML conversion, because if you execute the first command
$ ./../../bin/php/php5.3.6/bin/php app/console doctrine:mapping:convert xml ./src/Acme/TaskBundle/Resources/config/doctrine/ --from-database --forceUsing XML instead of YML it works in the expected way. I wonder if the author of this code have written a unit test before integrating this function in the official release of Doctrine.... (ironic question)
linuxatico
@doctrinebot commented on GitHub (May 27, 2012):
Comment created by @beberlei:
This case was indeed not unit-tested, many-to-one and one-to-one were handled the same in YAML Exporter. No need to get picky about it though, we are investing our free time here.
@doctrinebot commented on GitHub (May 27, 2012):
Issue was closed with resolution "Fixed"