silverstripe / silverstripe-framework

Silverstripe Framework, the MVC framework that powers Silverstripe CMS
https://www.silverstripe.org
BSD 3-Clause "New" or "Revised" License
723 stars 821 forks source link

CMS6: Default to utf8mb4 #11336

Open maxime-rainville opened 1 month ago

maxime-rainville commented 1 month ago

Description

A while back, we put some effort in making easy to set up up your database to store Emojis and fanciful characters in your DB fields. However, we didn't want to force people to upgrade their project to the 4-bit UTF8 charset ... because breaking change.

We did add a better config in recipe-cms so people creating brand new projects would get the 4-bit charset.

However, we forgot to update the default charset and collation in CMS 5 ... so people still have to keep that snippet in their YML config if they want to use 4-bit UTF8 char.

We should update CMS 6 to use 4-bit UTF8 char out of the box.

Additional context or points of discussion

This bit should be removed in CMS 6: https://github.com/silverstripe/recipe-core/blob/5/app/_config/mysite.yml#L7-L16

Instead the matching config values should be set directly in MySQLDatabase: https://github.com/silverstripe/silverstripe-framework/blob/5/src/ORM/Connect/MySQLDatabase.php#L28-L76

Validations

GuySartorelli commented 1 month ago

Makes sense to me