Skip to content
Snippets Groups Projects
Unverified Commit ee523fb8 authored by Seamus Lee's avatar Seamus Lee Committed by GitHub
Browse files

Merge pull request #18642 from seamuslee001/dev_core_339_custom_field

#334 Use the current in use collation and character sets when…
parents 6f776cf7 799f3149
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