mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
doctrine:mapping:import ignores tables #5107
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 @Chev12 on GitHub (Apr 19, 2016).
Considering this schema:
Table A
Table B
Table C
Where C has (idA, idB) as a PK, and has 2 FK, one referencing A, the other one referencing B.
When using doctrine:mapping:import, the tool just ignores C and makes a ManyToMany relationship between A and B, even if C has additional columns.
I digged the code and found the source of the problem and tried for a fix : https://github.com/doctrine/doctrine2/pull/5790
It was doing well locally for me but for reasons unknown the tests are failing.
Note that, with this fix, trying to generate some similar tables, instead of being treated as ManyToMany join tables, made the tool throw this error:
It is not possible to map entity 'ExempleBundle\Entity\Entite1' with a composite primary key as part of the primary key of another entity 'ExempleBundle\Entity\Entite2#entite1'.
Which is more relevant for the user than the obscure ManyToMany generation.