From 90fc763bb5aff82be367b0a1ce9859c93256871c Mon Sep 17 00:00:00 2001 From: Morgan Pichat Date: Mon, 25 Sep 2023 16:33:06 +0200 Subject: [PATCH] remove runSchemaUpgradeCommand --- .../UpgradeTools/CoreUpgrader/CoreUpgrader17.php | 10 ---------- .../UpgradeTools/CoreUpgrader/CoreUpgrader80.php | 10 ---------- classes/UpgradeTools/SymfonyAdapter.php | 16 ---------------- 3 files changed, 36 deletions(-) diff --git a/classes/UpgradeTools/CoreUpgrader/CoreUpgrader17.php b/classes/UpgradeTools/CoreUpgrader/CoreUpgrader17.php index 766258374d..055e653cce 100644 --- a/classes/UpgradeTools/CoreUpgrader/CoreUpgrader17.php +++ b/classes/UpgradeTools/CoreUpgrader/CoreUpgrader17.php @@ -56,16 +56,6 @@ protected function initConstants() $this->container->getSymfonyAdapter()->initAppKernel(); } - protected function upgradeDb($oldversion) - { - parent::upgradeDb($oldversion); - - $commandResult = $this->container->getSymfonyAdapter()->runSchemaUpgradeCommand(); - if (0 !== $commandResult['exitCode']) { - throw (new UpgradeException($this->container->getTranslator()->trans('Error upgrading Doctrine schema', [], 'Modules.Autoupgrade.Admin')))->setQuickInfos(explode("\n", $commandResult['output'])); - } - } - protected function upgradeLanguage($lang) { $isoCode = $lang['iso_code']; diff --git a/classes/UpgradeTools/CoreUpgrader/CoreUpgrader80.php b/classes/UpgradeTools/CoreUpgrader/CoreUpgrader80.php index aab8f2f872..8bb0134f15 100644 --- a/classes/UpgradeTools/CoreUpgrader/CoreUpgrader80.php +++ b/classes/UpgradeTools/CoreUpgrader/CoreUpgrader80.php @@ -61,16 +61,6 @@ protected function forceRemovingFiles() } } - protected function upgradeDb($oldversion) - { - parent::upgradeDb($oldversion); - - $commandResult = $this->container->getSymfonyAdapter()->runSchemaUpgradeCommand(); - if (0 !== $commandResult['exitCode']) { - throw (new UpgradeException($this->container->getTranslator()->trans('Error upgrading Doctrine schema', [], 'Modules.Autoupgrade.Admin')))->setQuickInfos(explode("\n", $commandResult['output'])); - } - } - protected function upgradeLanguage($lang) { $isoCode = $lang['iso_code']; diff --git a/classes/UpgradeTools/SymfonyAdapter.php b/classes/UpgradeTools/SymfonyAdapter.php index cd391f089e..bdc5395340 100644 --- a/classes/UpgradeTools/SymfonyAdapter.php +++ b/classes/UpgradeTools/SymfonyAdapter.php @@ -42,22 +42,6 @@ public function __construct($destinationPsVersion) $this->destinationPsVersion = $destinationPsVersion; } - public function runSchemaUpgradeCommand() - { - if (version_compare($this->destinationPsVersion, '1.7.1.1', '>=')) { - $schemaUpgrade = new \PrestaShopBundle\Service\Database\Upgrade(); - $outputCommand = 'prestashop:schema:update-without-foreign'; - } else { - $schemaUpgrade = new \PrestaShopBundle\Service\Cache\Refresh(); - $outputCommand = 'doctrine:schema:update'; - } - - $schemaUpgrade->addDoctrineSchemaUpdate(); - $output = $schemaUpgrade->execute(); - - return $output[$outputCommand]; - } - /** * Return the AppKernel, after initialization *