From ff38f0c3bed344d3017e38d0fcda8821fb9ae61e Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Wed, 6 Jan 2016 14:11:09 +0800 Subject: [PATCH] UpdateDatabase/MysqlLinks.php --- UpdateDatabase/MysqlLinks.php | 68 +---------------------------------- 1 file changed, 1 insertion(+), 67 deletions(-) diff --git a/UpdateDatabase/MysqlLinks.php b/UpdateDatabase/MysqlLinks.php index 4af23dc3..1847f784 100644 --- a/UpdateDatabase/MysqlLinks.php +++ b/UpdateDatabase/MysqlLinks.php @@ -448,73 +448,7 @@ class Pman_Core_UpdateDatabase_MysqlLinks { return $ret; } - function updateCharacterSet() - { - foreach (array_keys($this->schema) as $tbl){ - - if(strpos($tbl, '__keys') !== false ){ - continue; - } - - $ce = DB_DataObject::factory('core_enum'); - - $ce->query(" - SELECT - CCSA.character_set_name csname, - CCSA.collation_name collatename - FROM - information_schema.`TABLES` T, - information_schema.`COLLATION_CHARACTER_SET_APPLICABILITY` CCSA - WHERE - CCSA.collation_name = T.table_collation - AND - T.table_schema = '{$ce->database()}' -- COLLATE utf8_general_ci - AND - T.table_name = '{$tbl}' -- COLLATE utf8_general_ci - "); - - $ce->fetch(); - - if($ce->csname == 'utf8' && $ce->collatename == 'utf8_general_ci'){ - echo "$tbl is Already utf8 \n"; - continue; - } - // this used to be utf8_unicode_ci - //as the default collation for stored procedure parameters is utf8_general_ci and you can't mix collations. - - $ce = DB_DataObject::factory('core_enum'); - $ce->query("ALTER TABLE {$tbl} CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci"); - echo "FIXED utf8 on {$tbl}\n"; - - } - } - function updateEngine() - { - foreach (array_keys($this->schema) as $tbl){ - - if(strpos($tbl, '__keys') !== false ){ - continue; - } - - $ce = DB_DataObject::factory('core_enum'); - - $ce->query("select engine from information_schema.tables where table_schema='hydra' and table_name = 'core_enum'"); - - $ce->fetch(); - - if($ce->engine == 'InnoDB' ){ - echo "SKIP engine on $tbl - already InnoDB\n"; - continue; - } - // this used to be utf8_unicode_ci - //as the default collation for stored procedure parameters is utf8_general_ci and you can't mix collations. - - $ce = DB_DataObject::factory('core_enum'); - $ce->query("ALTER TABLE $tbl ENGINE=InnoDB"); - echo "FIXED engine on {$tbl}\n"; - - } - } + } -- 2.39.2