This command can be used to convert the database configured in the Flow settings to the utf8 character
set and the utf8_unicode_ci collation (by default, a custom collation can be given). It will only
work when using the pdo_mysql driver.
Make a backup before using it, to be on the safe side. If you want to inspect the statements used
for conversion, you can use the $output parameter to write them into a file. This file can be used to do
the conversion manually.
For background information on this, see:
- http://stackoverflow.com/questions/766809/
- http://dev.mysql.com/doc/refman/5.5/en/alter-table.html
The main purpose of this is to fix setups that were created with Flow 2.3.x or earlier and whose
database server did not have a default collation of utf8_unicode_ci. In those cases, the tables will
have a collation that does not match the default collation of later Flow versions, potentially leading
to problems when creating foreign key constraints (among others, potentially).
If you have special needs regarding the charset and collation, you can override the defaults with
different ones. One thing this might be useful for is when switching to the utf8mb4 character set, see:
- https://mathiasbynens.be/notes/mysql-utf8mb4
- https://florian.ec/articles/mysql-doctrine-utf8/
Note: This command is not a general purpose conversion tool. It will specifically not fix cases
of actual utf8 stored in latin1 columns. For this a conversion to BLOB followed by a conversion to the
proper type, charset and collation is needed instead.