task-bundle icon indicating copy to clipboard operation
task-bundle copied to clipboard

Fix incompatible charset & collation and change it to utf8mb4

Open Maxooo opened this issue 5 years ago • 2 comments

Description

This PR aims to resolve the following problematics.

Doctrine Charset

If the Doctrine charset defined in the project configuration is not equal to utf8 it become impossible for Doctrine to create the schema as it try to create the table with incompatible charset and collation.

For example if your project is configured like this :

doctrine:
    dbal:
        charset: utf8mb4
        default_table_options:
          charset: utf8mb4
          collate: utf8mb4_unicode_ci

(...) running the bin/console doctrine:schema:create command will result in the following error :

SQLSTATE[42000]: Syntax error or access violation: 1253 COLLATION 'utf8_swedish_ci' is not valid for CHARACTER SET 'utf8mb4'' while executing DDL:

Setting the charset explicitly and accordingly with the collation in the table definition will fixi this issue.

/**
 * @ORM\Table(
 *   name="task_queue",
 *   options={"collate"="utf8_swedish_ci", "charset"="utf8"},
 * ...
 */

Alphabet limitations

As we are working on this part, I recommend to change the collation swedish to the more standardized one unicode using the utf8mb4 charset to support Asian and more foreign alphabets.

Maxooo avatar Nov 28 '19 14:11 Maxooo

just ran into this issue myself, so would welcome this to be changed.

da-anda avatar Jan 29 '20 18:01 da-anda

Just ran into this issue too. If you could merge it we would be very grateful !

bdurst42 avatar Jun 09 '21 16:06 bdurst42