Skip to content

Conversation

@Maxooo
Copy link

@Maxooo Maxooo commented Nov 28, 2019

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.

@da-anda
Copy link

da-anda commented Jan 29, 2020

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

@bdurst42
Copy link

bdurst42 commented Jun 9, 2021

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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants