Jira issue originally created by user eatnut:
My MySQL server has default character set utf8mb4 and collation utf8mb4*unicode*ci.
Database created for ORM has the same character set and collation as the server.
When I use command doctrine orm:schema-tool:create to create a schema, a table with character set utf8 and collation utf8*unicode_ci is created (should be utf8mb4 and utf8mb4_unicode*ci).
When I use mysql client to create table, no problem at all.
I'm not sure is it intended or not, doctrine will just ignore utf8mb4 character set?
Comment created by @ocramius:
Doctrine automatically adds utf8 and utf8*unicode*ci as charset and collation in the DDL used to create tables.
You will need to manually tweak this using additional table-specific mappings.
Issue was closed with resolution "Invalid"
Even if I defined table-specific charset and collation, the created join table of many-to-many relation are still in UTF-8, although it's not matter because that join table will be two integer columns only, but this is still a weird behavior.
@phoenixgao what charset and collation would you expect Doctrine to use for a join table if both primary tables would have different charset and collation definitions (besides the fact that it doesn't affect integer columns anyways as you pointed out). This is no big deal IMO.
Please remember, in the end the charset and collation defined on the table is only used as default if no column charset is specified in the definition. So this really has no impact if you define a collation explicitly on each column.
What happens when string identifiers are used? Does each FK column in the link-table have the appropriate/matching encoding as the corresponding PKs?