This repository was archived by the owner on Oct 9, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -244,6 +244,9 @@ static function install(Migration $migration) {
244
244
$ table = getTableForItemType (__CLASS__ );
245
245
246
246
if (!$ DB ->tableExists ($ table )) {
247
+ $ default_charset = DBConnection::getDefaultCharset ();
248
+ $ default_collation = DBConnection::getDefaultCollation ();
249
+
247
250
$ query = "CREATE TABLE ` " .$ table ."` (
248
251
`id` int NOT NULL AUTO_INCREMENT,
249
252
`host` varchar(255) NOT NULL default '',
@@ -265,7 +268,7 @@ static function install(Migration $migration) {
265
268
`use_proxy` int NOT NULL DEFAULT 0,
266
269
`is_password_sodium_encrypted` int NOT NULL DEFAULT 1,
267
270
PRIMARY KEY (`id`)
268
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ; " ;
271
+ ) ENGINE=InnoDB DEFAULT CHARSET= { $ default_charset } COLLATE= { $ default_collation } ; " ;
269
272
$ DB ->query ($ query ) or die ($ DB ->error ());
270
273
271
274
$ query = "INSERT INTO ` $ table` (id) VALUES (1) " ;
Original file line number Diff line number Diff line change @@ -107,6 +107,8 @@ static function install(Migration $migration) {
107
107
$ table = getTableForItemType (__CLASS__ );
108
108
109
109
if (!$ DB ->tableExists ($ table )) {
110
+ $ default_charset = DBConnection::getDefaultCharset ();
111
+ $ default_collation = DBConnection::getDefaultCollation ();
110
112
111
113
$ query = "CREATE TABLE ` " .$ table ."` (
112
114
`id` int NOT NULL AUTO_INCREMENT,
@@ -116,7 +118,7 @@ static function install(Migration $migration) {
116
118
`itemtype` varchar(255) NOT NULL,
117
119
`user` int NOT NULL,
118
120
PRIMARY KEY (`id`)
119
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ; " ;
121
+ ) ENGINE=InnoDB DEFAULT CHARSET= { $ default_charset } COLLATE= { $ default_collation } ; " ;
120
122
$ DB ->query ($ query ) or die ($ DB ->error ());
121
123
122
124
} else {
You can’t perform that action at this time.
0 commit comments