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 @@ -239,6 +239,9 @@ static function install(Migration $migration) {
239
239
$ table = getTableForItemType (__CLASS__ );
240
240
241
241
if (!$ DB ->tableExists ($ table )) {
242
+ $ default_charset = DBConnection::getDefaultCharset ();
243
+ $ default_collation = DBConnection::getDefaultCollation ();
244
+
242
245
$ query = "CREATE TABLE ` " .$ table ."` (
243
246
`id` int NOT NULL AUTO_INCREMENT,
244
247
`host` varchar(255) NOT NULL default '',
@@ -260,7 +263,7 @@ static function install(Migration $migration) {
260
263
`use_proxy` int NOT NULL DEFAULT 0,
261
264
`is_password_sodium_encrypted` int NOT NULL DEFAULT 1,
262
265
PRIMARY KEY (`id`)
263
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ; " ;
266
+ ) ENGINE=InnoDB DEFAULT CHARSET= { $ default_charset } COLLATE= { $ default_collation } ; " ;
264
267
$ DB ->query ($ query ) or die ($ DB ->error ());
265
268
266
269
$ query = "INSERT INTO ` $ table` (id) VALUES (1) " ;
Original file line number Diff line number Diff line change @@ -102,6 +102,8 @@ static function install(Migration $migration) {
102
102
$ table = getTableForItemType (__CLASS__ );
103
103
104
104
if (!$ DB ->tableExists ($ table )) {
105
+ $ default_charset = DBConnection::getDefaultCharset ();
106
+ $ default_collation = DBConnection::getDefaultCollation ();
105
107
106
108
$ query = "CREATE TABLE ` " .$ table ."` (
107
109
`id` int NOT NULL AUTO_INCREMENT,
@@ -111,7 +113,7 @@ static function install(Migration $migration) {
111
113
`itemtype` varchar(255) NOT NULL,
112
114
`user` int NOT NULL,
113
115
PRIMARY KEY (`id`)
114
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ; " ;
116
+ ) ENGINE=InnoDB DEFAULT CHARSET= { $ default_charset } COLLATE= { $ default_collation } ; " ;
115
117
$ DB ->query ($ query ) or die ($ DB ->error ());
116
118
117
119
} else {
You can’t perform that action at this time.
0 commit comments