Skip to content

Commit

Permalink
dev/core#334 Use the current in use collation and character sets when…
Browse files Browse the repository at this point in the history
… creating new custom value tables
  • Loading branch information
seamuslee001 committed Sep 30, 2020
1 parent af846d5 commit c244d48
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion CRM/Core/BAO/CustomField.php
Original file line number Diff line number Diff line change
Expand Up @@ -1610,10 +1610,15 @@ public static function formatCustomField(
*/
public static function defaultCustomTableSchema($params) {
// add the id and extends_id
$collation = CRM_Core_BAO_SchemaHandler::getInUseCollation();
$characterSet = 'utf8';
if (stristr($collaction, 'utf8mb4')) {
$characterSet = 'utf8mb4';
}
$table = [
'name' => $params['name'],
'is_multiple' => $params['is_multiple'],
'attributes' => "ENGINE=InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci",
'attributes' => "ENGINE=InnoDB DEFAULT CHARACTER SET {$characterSet} COLLATE {$collation}",
'fields' => [
[
'name' => 'id',
Expand Down

0 comments on commit c244d48

Please sign in to comment.