From 36a9626f8151236cd1249815ba5ecf833ec644ce Mon Sep 17 00:00:00 2001
From: mattab <matthieu.aubry@gmail.com>
Date: Wed, 5 Feb 2014 14:07:15 +1300
Subject: [PATCH] Streamline config. fixes #4611

---
 config/global.ini.php     |  2 ++
 core/Db/Schema.php        | 10 ++--------
 core/Updates/0.6.3.php    |  2 --
 core/Updates/1.8.4-b1.php |  2 +-
 4 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/config/global.ini.php b/config/global.ini.php
index df84a0e3a4..1b3462453f 100644
--- a/config/global.ini.php
+++ b/config/global.ini.php
@@ -20,6 +20,7 @@ tables_prefix =
 port = 3306
 adapter = PDO_MYSQL
 type = InnoDB
+schema = Mysql
 
 ; if charset is set to utf8, Piwik will ensure that it is storing its data using UTF8 charset.
 ; it will add a sql query SET at each page view.
@@ -35,6 +36,7 @@ tables_prefix = piwiktests_
 port = 3306
 adapter = PDO_MYSQL
 type = InnoDB
+schema = Mysql
 
 [log]
 ; possible values for log: screen, database, file
diff --git a/core/Db/Schema.php b/core/Db/Schema.php
index ff9854b910..13fd0fe44c 100644
--- a/core/Db/Schema.php
+++ b/core/Db/Schema.php
@@ -49,11 +49,9 @@ class Schema extends Singleton
     public static function getSchemas($adapterName)
     {
         static $allSchemaNames = array(
-            // MySQL storage engines
             'MYSQL' => array(
                 'Mysql',
-//				'Innodb',
-//				'Infinidb',
+                // InfiniDB
             ),
 
             // Microsoft SQL Server
@@ -112,11 +110,7 @@ class Schema extends Singleton
     {
         $config = Config::getInstance();
         $dbInfos = $config->database;
-        if (isset($dbInfos['schema'])) {
-            $schemaName = $dbInfos['schema'];
-        } else {
-            $schemaName = 'Mysql';
-        }
+        $schemaName = $dbInfos['schema'];
         $className = self::getSchemaClassName($schemaName);
         $this->schema = new $className();
     }
diff --git a/core/Updates/0.6.3.php b/core/Updates/0.6.3.php
index eba5b42851..87ef2d27a1 100644
--- a/core/Updates/0.6.3.php
+++ b/core/Updates/0.6.3.php
@@ -35,14 +35,12 @@ class Updates_0_6_3 extends Updates
         if (!isset($dbInfos['schema'])) {
             try {
                 if (is_writable(Config::getLocalConfigPath())) {
-                    $dbInfos['schema'] = 'Myisam';
                     $config->database = $dbInfos;
                     $config->forceSave();
                 } else {
                     throw new \Exception('mandatory update failed');
                 }
             } catch (\Exception $e) {
-                throw new \Piwik\UpdaterErrorException("Please edit your config/config.ini.php file and add below <code>[database]</code> the following line: <br /><code>schema = Myisam</code>");
             }
         }
 
diff --git a/core/Updates/1.8.4-b1.php b/core/Updates/1.8.4-b1.php
index 7c4b6984f8..97e70daa8d 100644
--- a/core/Updates/1.8.4-b1.php
+++ b/core/Updates/1.8.4-b1.php
@@ -72,7 +72,7 @@ class Updates_1_8_4_b1 extends Updates
 				 `before` int(10) unsigned NOT NULL,
 				 `after` int(10) unsigned NOT NULL,
 				 KEY `mainkey` (`before`)
-				) ENGINE=MyISAM;
+				) ENGINE=InnoDB;
 			"                                                            => false,
 
             // grouping by name only would be case-insensitive, so we GROUP BY name,hash
-- 
GitLab