Bug fixes for utf8mb4
This commit is contained in:
@@ -379,14 +379,14 @@ class MySqlPlatform extends \Doctrine\DBAL\Platforms\MySqlPlatform
|
||||
|
||||
// Charset
|
||||
if ( ! isset($options['charset'])) {
|
||||
$options['charset'] = 'utf8';
|
||||
$options['charset'] = 'utf8mb4';
|
||||
}
|
||||
|
||||
$tableOptions[] = sprintf('DEFAULT CHARACTER SET %s', $options['charset']);
|
||||
|
||||
// Collate
|
||||
if ( ! isset($options['collate'])) {
|
||||
$options['collate'] = 'utf8_unicode_ci';
|
||||
$options['collate'] = 'utf8mb4_unicode_ci';
|
||||
}
|
||||
|
||||
$tableOptions[] = sprintf('COLLATE %s', $options['collate']);
|
||||
@@ -465,4 +465,4 @@ class MySqlPlatform extends \Doctrine\DBAL\Platforms\MySqlPlatform
|
||||
return implode(', ', $queryFields);
|
||||
}
|
||||
//end: ESPO
|
||||
}
|
||||
}
|
||||
|
||||
@@ -373,6 +373,13 @@ class Converter
|
||||
}
|
||||
}
|
||||
|
||||
$databaseParams = $this->getConfig()->get('database');
|
||||
if (!isset($databaseParams['charset']) || $databaseParams['charset'] == 'utf8mb4') {
|
||||
$dbFieldParams['platformOptions'] = array(
|
||||
'collation' => 'utf8mb4_unicode_ci',
|
||||
);
|
||||
}
|
||||
|
||||
switch ($fieldParams['type']) {
|
||||
case 'id':
|
||||
case 'foreignId':
|
||||
@@ -515,4 +522,4 @@ class Converter
|
||||
|
||||
return $tables;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user