Skip to content

Commit

Permalink
ENH Default DB settings to use 4 bytes to store UTF8 characters
Browse files Browse the repository at this point in the history
  • Loading branch information
maxime-rainville committed Oct 19, 2024
1 parent 666b409 commit acbde0c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/ORM/Connect/MySQLDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
use SilverStripe\ORM\DataList;
use SilverStripe\Model\List\ArrayList;
use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\Queries\SQLSelect;
use Exception;

/**
Expand All @@ -31,23 +30,23 @@ class MySQLDatabase extends Database implements TransactionManager
* @config
* @var String
*/
private static $connection_charset = 'utf8';
private static $connection_charset = 'utf8mb4';

/**
* Default connection collation
*
* @config
* @var string
*/
private static $connection_collation = 'utf8_general_ci';
private static $connection_collation = 'utf8mb4_unicode_ci';

/**
* Default charset
*
* @config
* @var string
*/
private static $charset = 'utf8';
private static $charset = 'utf8mb4';

/**
* SQL Mode used on connections to MySQL. Defaults to ANSI. For basic ORM
Expand All @@ -73,7 +72,7 @@ class MySQLDatabase extends Database implements TransactionManager
* @config
* @var string
*/
private static $collation = 'utf8_general_ci';
private static $collation = 'utf8mb4_unicode_ci';

public function connect($parameters)
{
Expand Down

0 comments on commit acbde0c

Please sign in to comment.