From d8bf6048c1ae8bd7a3a07e61b27e09266708552a Mon Sep 17 00:00:00 2001 From: Taras Machyshyn Date: Wed, 9 Sep 2020 15:49:58 +0300 Subject: [PATCH 1/2] Upgrade script: check MyISAM --- upgrades/6.0/scripts/AfterUpgrade.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/upgrades/6.0/scripts/AfterUpgrade.php b/upgrades/6.0/scripts/AfterUpgrade.php index b282b34f0f..9d89ecc796 100644 --- a/upgrades/6.0/scripts/AfterUpgrade.php +++ b/upgrades/6.0/scripts/AfterUpgrade.php @@ -138,4 +138,25 @@ class AfterUpgrade } } } + + protected function isUseMyisam($container) + { + $pdo = $container->get('entityManager')->getPDO(); + $databaseInfo = $container->get('config')->get('database'); + + try { + $sth = $pdo->prepare("SELECT TABLE_NAME as tableName FROM information_schema.TABLES WHERE TABLE_SCHEMA = '". $databaseInfo['dbname'] ."' and ENGINE = 'MyISAM'"); + $sth->execute(); + } catch (\Exception $e) { + return false; + } + + $tableList = $sth->fetchAll(\PDO::FETCH_NUM); + + if (empty($tableList)) { + return false; + } + + return true; + } } From 412966d8d03cf67cc07a3af31ba48c38586af0ce Mon Sep 17 00:00:00 2001 From: Taras Machyshyn Date: Wed, 9 Sep 2020 16:10:46 +0300 Subject: [PATCH 2/2] Upgrade script: fixes --- upgrades/6.0/scripts/AfterUpgrade.php | 32 ++++++++------------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/upgrades/6.0/scripts/AfterUpgrade.php b/upgrades/6.0/scripts/AfterUpgrade.php index 9d89ecc796..ad869b7383 100644 --- a/upgrades/6.0/scripts/AfterUpgrade.php +++ b/upgrades/6.0/scripts/AfterUpgrade.php @@ -3,8 +3,8 @@ * This file is part of EspoCRM. * * EspoCRM - Open Source CRM application. - * Copyright (C) 2014 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko - * Website: http://www.espocrm.com + * Copyright (C) 2014-2020 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko + * Website: https://www.espocrm.com * * EspoCRM is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,6 +18,13 @@ * * You should have received a copy of the GNU General Public License * along with EspoCRM. If not, see http://www.gnu.org/licenses/. + * + * The interactive user interfaces in modified source and object code versions + * of this program must display Appropriate Legal Notices, as required under + * Section 5 of the GNU General Public License version 3. + * + * In accordance with Section 7(b) of the GNU General Public License version 3, + * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ use Espo\Core\Utils\Util; @@ -138,25 +145,4 @@ class AfterUpgrade } } } - - protected function isUseMyisam($container) - { - $pdo = $container->get('entityManager')->getPDO(); - $databaseInfo = $container->get('config')->get('database'); - - try { - $sth = $pdo->prepare("SELECT TABLE_NAME as tableName FROM information_schema.TABLES WHERE TABLE_SCHEMA = '". $databaseInfo['dbname'] ."' and ENGINE = 'MyISAM'"); - $sth->execute(); - } catch (\Exception $e) { - return false; - } - - $tableList = $sth->fetchAll(\PDO::FETCH_NUM); - - if (empty($tableList)) { - return false; - } - - return true; - } }