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

!!!TASK: Change default charset and collation to utf8mb4 #1991

Merged
merged 3 commits into from
Apr 19, 2018

Conversation

kdambekalns
Copy link
Member

@kdambekalns kdambekalns commented Apr 9, 2018

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
@kdambekalns
Copy link
Member Author

See neos/flow-development-collection#1268 for all related PRs

Copy link
Member

@bwaidelich bwaidelich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good by reading

* PHP >= 7.0.0 (make sure the PHP CLI has the same version)
* A Database (MySQL > 5.7.7, MariaDB > 10.2.2 and PostgreSQL > 9.4 are preferred
but any `Database supported by Doctrine DBAL <http://www.doctrine-project.org/projects/dbal.html>`_
should work as well).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that true ? as we don't provide migration for other DB engine ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not tested, but should work. I know I have seen Neos on other engines.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It all boils down to creating your own migrations and/or using doctrine:update 🙈

@kitsunet kitsunet merged commit 7607d81 into neos:master Apr 19, 2018
@kdambekalns kdambekalns deleted the use-utf8mb4-charset branch April 19, 2018 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants