mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-3476: JoinTable options are not inherited #4282
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 (Jan 6, 2015).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user eschultz:
I'm working with Symfony 2.6 and Doctrine (MySQL), but the error is in the Doctrine 2 ORM.
I have specified a ManyToMany relation like so:
All tables should be created as MyISAM and "utf8_general_ci" collation instead of InnoDB and "utf8_unicode_ci". This works fine for all tables except for "user_groups" table because the options are not inherited. As a result the schema is not valid, because foreign keys cannot be created over 2 different collations.
To fix this, I modified class "\Doctrine\ORM\Tools\SchemaTool", function "gatherRelationsSql($class, $table, $schema, &$addedFks, &$blacklistedFks)" and added the following lines in the MANY_TO_MANY block:
Now, it works as I want. The new table is created with the right collation and engine and the foreign keys are created correct. Could you please implement this fix?
@doctrinebot commented on GitHub (Jan 6, 2015):
Comment created by eschultz:
Please also have a look at DDC-972 where MyISAM support was added. The problem was already mentioned there in the last 4 comments, so it exists at least since 2012.