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
!!!TASK: Change default charset and collation to utf8mb4 #1267
Conversation
This changes the charset and collation to create table statements in the existing migrations. This make sure the tables are set up correctly independent of the database default configuration. This is breaking if you have existing tables that do not use ut8mb4 as charset and utf8mb4_unicode_ci as collation. To solve this you need to convert the existing tables. This can be done using the command:: ./flow database:setcharset This will convert the database configured in the settings and all tables inside to use a default character set of utf8mb4 and a default collation of utf8mb4_unicode_ci. It will also convert all character type columns to that combination of charset and collation. Background information on why this is done can be found in https://medium.com/@adamhooper/in-mysql-never-use-utf8-use-utf8mb4-11761243e434
The nice thing is, that our tests directly show the single one drawback of using utf8mb4 😆 |
Yep, that's an issue... But we must face it! 😆 |
See #1268 for all related PRs |
Ok, digging into the key length issue… no problems locally. Running MariaDB 10.2.12, and for all I can find, this is solved as of MariaDB 10.2.2 (which was released in 2016-09-27). With MySQL one needs MySQL v5.7.7 (released 2015-04-08) for this to "magically" be solved. If this is the case… we should probably just update the minimum DB versions, with PHP 7.1 being required and 2018 being a quarter in, that seems appropriate to me. From https://laravel.com/docs/master/migrations#creating-indexes
|
Ok, with MariaDB 10.2 the "MySQL" tests do pass. PostgreSQL fails, but that is because Doctrine passes the charset from the (changed) default settings on, and PostgreSQL does not understand The question now is… do we build in some more magic to (re)set this depending on the DB used, allow to configure options per driver used or simply require users to change the settings as needed when using PostgreSQL (and adjust our test setup)? |
This is set based on the charset to a sane default by Doczrine, so not needed in the Flow settings.
Some more changes to this one… and with neos/BuildEssentials#34 PostgreSQL should work as well. |
YAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY I like it, lets do that! |
Yay, all green now. See https://discuss.neos.io/t/rfc-switch-to-utf8mb4-raise-db-requirements/3274 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Green and looking good by reading.
!!!TASK: Change default charset and collation to utf8mb4 This changes the charset and collation to create table statements in the existing migrations. This make sure the tables are set up correctly independent of the database default configuration. This is breaking if you have existing tables that do not use ut8mb4 as charset and utf8mb4_unicode_ci as collation. To solve this you need to convert the existing tables. This can be done using the command:: ./flow database:setcharset This will convert the database configured in the settings and all tables inside to use a default character set of utf8mb4 and a default collation of utf8mb4_unicode_ci. It will also convert all character type columns to that combination of charset and collation. Background information on why this is done can be found in https://medium.com/@adamhooper/in-mysql-never-use-utf8-use-utf8mb4-11761243e434
This changes the charset and collation to create table statements in the
existing migrations. This make sure the tables are set up correctly
independent of the database default configuration.
This is breaking if you have existing tables that do not use ut8mb4 as
charset and utf8mb4_unicode_ci as collation. To solve this you need to
convert the existing tables. This can be done using the command::
./flow database:setcharset
This will convert the database configured in the settings and all tables
inside to use a default character set of utf8mb4 and a default collation
of utf8mb4_unicode_ci. It will also convert all character type columns
to that combination of charset and collation.
Background information on why this is done can be found in
https://medium.com/@adamhooper/in-mysql-never-use-utf8-use-utf8mb4-11761243e434