Add connection charset sync with WP and convert existing data to it

This commit is contained in:
Tautvidas Sipavičius
2017-05-18 00:00:00 +03:00
parent 21d0c3518e
commit a6eb1b06da
5 changed files with 68 additions and 6 deletions

View File

@ -12,7 +12,7 @@ require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
class Migrator {
function __construct() {
$this->prefix = Env::$db_prefix;
$this->charset = Env::$db_charset;
$this->charset_collate = Env::$db_charset_collate;
$this->models = array(
'segments',
'settings',
@ -369,7 +369,7 @@ class Migrator {
$sql = array();
$sql[] = "CREATE TABLE " . $table . " (";
$sql = array_merge($sql, $attributes);
$sql[] = ") " . $this->charset . ";";
$sql[] = ") " . $this->charset_collate . ";";
return implode("\n", $sql);
}