[DDC-2421] Many-To-Many relation creation failed when using non PK entity field Created: 29/Apr/13 Updated: 10/Sep/13 Resolved: 01/May/13
|Project:||Doctrine 2 - ORM|
|Component/s:||Mapping Drivers, Tools|
|Affects Version/s:||Git Master, 2.3.3|
|Reporter:||Bruno CHALOPIN||Assignee:||Benjamin Eberlei|
Ubuntu linux 12.04, php 5.4.9
Given these entities :
I've got a domain, some web sites per domain and websgroups which group web sites. I want to be sure in my database that a web group from a domain D can contain only web sites from the very same domain but when calling the console tool for creating my schema it raise :
It's because domain is already an association to an entity which and is not part of the primary key.
I've quick fixed getDefiningClass from Doctrine\ORM\Tools\SchemaTool to make it work but i really don't know if it's the proper way :
|Comment by Fabio B. Silva [ 29/Apr/13 ]|
Bruno CHALOPIN Except for some CS this fix seems good.
If you have time you can send as pull request
|Comment by Bruno CHALOPIN [ 30/Apr/13 ]|
I've start making a PR and a test case but it is linked to http://www.doctrine-project.org/jira/browse/DDC-2413
|Comment by Benjamin Eberlei [ 01/May/13 ]|
You cannot use a reference column that is not a primary key. Doctrine does not support this.
|Comment by Bavo Janss [ 10/Sep/13 ]|
I stumbled on this issue when experiencing a similar bug.
To me doctrine checks the the referencedColumn for existence but after that just creates everything assuming the default PK 'id'.