Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

utf8mb4 character set causes migrations table creation to fail #514

Closed
jaikdean opened this issue Mar 7, 2017 · 3 comments
Closed

utf8mb4 character set causes migrations table creation to fail #514

jaikdean opened this issue Mar 7, 2017 · 3 comments
Milestone

Comments

@jaikdean
Copy link

jaikdean commented Mar 7, 2017

I have a project using MySQL 5.6 set up to use utf8mb4 character set and utf8mb4_unicode_ci collation. Having this set means the migration_versions table fails to be created with the following error:

1071 Specified key was too long; max key length is 767 bytes

The version field length of 255 is hardcoded in Doctrine\DBAL\Migrations\Configuration\Configuration::createMigrationTable(), as is creation of the table itself, so there is no way to override the character set or adjust the field length without overriding this method.

@mikeSimonson
Copy link
Contributor

That's one of the reason why utf8mb4_general_ci is recommended over utf8mb4_unicode_ci.
Nonetheless if you feel like it, I would welcome a PR to configure that.
You would need to enforce that new limitation in the MigrationFinder too thought.

@lcobucci
Copy link
Member

Related to #538

@jwage jwage added this to the 2.0 milestone May 5, 2018
@jwage jwage closed this as completed May 17, 2018
@jwage
Copy link
Member

jwage commented May 17, 2018

Closing this as you can now set the column length.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants