Skip to content
Snippets Groups Projects
Commit 799f3149 authored by Seamus Lee's avatar Seamus Lee
Browse files

#334 Use the current in use collation and character sets when creating...

#334 Use the current in use collation and character sets when creating new custom value tables
parent 50a7682a
Branches
Tags
No related merge requests found
......@@ -1610,10 +1610,15 @@ SELECT $columnName
*/
public static function defaultCustomTableSchema($params) {
// add the id and extends_id
$collation = CRM_Core_BAO_SchemaHandler::getInUseCollation();
$characterSet = 'utf8';
if (stripos($collation, 'utf8mb4') !== FALSE) {
$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',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment