From 03e6abbfc32b065cef971680164ed071c7738ec5 Mon Sep 17 00:00:00 2001 From: Garion Herman Date: Tue, 12 Jan 2021 15:21:30 +1300 Subject: [PATCH] FIX Make UTF-MB4 collation / charset default opt-in This was originally intended as an opt-in change in Recipe 4.7.0, but was making its way into projects during upgrades due to its placement in a separate config file. --- app/_config/database.yml | 8 -------- app/_config/mysite.yml | 11 +++++++++++ 2 files changed, 11 insertions(+), 8 deletions(-) delete mode 100644 app/_config/database.yml diff --git a/app/_config/database.yml b/app/_config/database.yml deleted file mode 100644 index 8c8075b..0000000 --- a/app/_config/database.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -Name: myproject-database ---- -SilverStripe\ORM\Connect\MySQLDatabase: - connection_charset: utf8mb4 - connection_collation: utf8mb4_unicode_ci - charset: utf8mb4 - collation: utf8mb4_unicode_ci diff --git a/app/_config/mysite.yml b/app/_config/mysite.yml index 59c81b9..f786c18 100644 --- a/app/_config/mysite.yml +++ b/app/_config/mysite.yml @@ -3,3 +3,14 @@ Name: myproject --- SilverStripe\Core\Manifest\ModuleManifest: project: app + +# UTF8MB4 has limited support in older MySQL versions. +# Remove this configuration if you experience issues. +--- +Name: myproject-database +--- +SilverStripe\ORM\Connect\MySQLDatabase: + connection_charset: utf8mb4 + connection_collation: utf8mb4_unicode_ci + charset: utf8mb4 + collation: utf8mb4_unicode_ci