Skip to content

Loading…

DDC-2139: Table collate/charset doesn't inherits from database #2827

Closed
doctrinebot opened this Issue · 2 comments

2 participants

@doctrinebot

Jira issue originally created by user williamk:

Using symfony2 command doctrine:schema:create the tables and Varchar fields are Collate/Charset are not inherited from database. I changed MySQL defaults to latin1/latin1generalci; The doctrine:database:create works; but tables and fields don't. So I found there is a code on MySqlPlataform.php:

if ( ! isset($options['charset'])) {
$options['charset'] = 'utf8';
}

if ( ! isset($options['collate'])) {
$options['collate'] = 'utf8unicodeci';
}

$query .= 'DEFAULT CHARACTER SET ' . $options['charset'];
$query .= ' COLLATE ' . $options['collate'];

So if you don't pass collate and charset as entity options, it will put utf8 and utf8unicodeci instead of dabatase default charset.

My suggestion is to change a little bit to:

if (isset($options['charset'])) {
$query .= 'DEFAULT CHARACTER SET ' . $options['charset'];
}

if (isset($options['collate'])) {
$query .= ' COLLATE ' . $options['collate'];

}

@doctrinebot

Comment created by @beberlei:

If we change it, then it will be like before and users disliked that very much. The decision is to use UTF-8 as default and everybody else has to change the information instead of the other way around.

@doctrinebot

Issue was closed with resolution "Won't Fix"

@beberlei beberlei was assigned by doctrinebot
@doctrinebot doctrinebot closed this
@doctrinebot doctrinebot added the Bug label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.