ENH Default DB settings to use 4 bytes to store UTF8 characters

This commit is contained in:
Maxime Rainville 2024-10-19 23:36:26 +13:00
parent 666b4094b4
commit acbde0c24d
No known key found for this signature in database

View File

@ -10,7 +10,6 @@ use SilverStripe\Model\List\PaginatedList;
use SilverStripe\ORM\DataList; use SilverStripe\ORM\DataList;
use SilverStripe\Model\List\ArrayList; use SilverStripe\Model\List\ArrayList;
use SilverStripe\ORM\DataObject; use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\Queries\SQLSelect;
use Exception; use Exception;
/** /**
@ -31,7 +30,7 @@ class MySQLDatabase extends Database implements TransactionManager
* @config * @config
* @var String * @var String
*/ */
private static $connection_charset = 'utf8'; private static $connection_charset = 'utf8mb4';
/** /**
* Default connection collation * Default connection collation
@ -39,7 +38,7 @@ class MySQLDatabase extends Database implements TransactionManager
* @config * @config
* @var string * @var string
*/ */
private static $connection_collation = 'utf8_general_ci'; private static $connection_collation = 'utf8mb4_unicode_ci';
/** /**
* Default charset * Default charset
@ -47,7 +46,7 @@ class MySQLDatabase extends Database implements TransactionManager
* @config * @config
* @var string * @var string
*/ */
private static $charset = 'utf8'; private static $charset = 'utf8mb4';
/** /**
* SQL Mode used on connections to MySQL. Defaults to ANSI. For basic ORM * SQL Mode used on connections to MySQL. Defaults to ANSI. For basic ORM
@ -73,7 +72,7 @@ class MySQLDatabase extends Database implements TransactionManager
* @config * @config
* @var string * @var string
*/ */
private static $collation = 'utf8_general_ci'; private static $collation = 'utf8mb4_unicode_ci';
public function connect($parameters) public function connect($parameters)
{ {