Skip to content

Commit

Permalink
Call createProductCacheTable() before productCacheDataToLongtext()
Browse files Browse the repository at this point in the history
  • Loading branch information
olsi-qose committed Feb 27, 2020
1 parent 3df6a1f commit 770026c
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions Setup/UpgradeSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@

namespace Nosto\Tagging\Setup;

use Exception;
use Magento\Framework\DB\Ddl\Table;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\SchemaSetupInterface;
use Magento\Framework\Setup\UpgradeSchemaInterface;
use Nosto\Tagging\Api\Data\CustomerInterface;
use Nosto\Tagging\Logger\Logger;
use Nosto\Tagging\Model\Product\Cache;
use Nosto\Tagging\Model\ResourceModel\Customer;
use Nosto\Tagging\Model\ResourceModel\Product\Cache as CacheResource;
Expand All @@ -50,6 +52,18 @@ class UpgradeSchema extends Core implements UpgradeSchemaInterface
{
const PRODUCT_QUEUE_TABLE = 'nosto_tagging_product_queue';

/** @var Logger $loger */
private $loger;

/**
* UpgradeSchema constructor.
* @param Logger $loger
*/
public function __construct(Logger $loger)
{
$this->loger = $loger;
}

/**
* {@inheritdoc}
* @throws Zend_Db_Exception
Expand All @@ -61,12 +75,16 @@ public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $con
if (version_compare($fromVersion, '2.1.0', '<')) {
$this->addRestoreCartHash($setup);
}
if (version_compare($fromVersion, '4.0.0', '<=')) {
try {
$this->createProductCacheTable($setup);
} catch (Exception $e) {
$this->loger->exception($e);
}
}
if (version_compare($fromVersion, '4.0.3', '<=')) {
$this->productCacheDataToLongtext($setup);
}
if (version_compare($fromVersion, '4.0.4', '<=')) {
$this->createProductCacheTable($setup);
}
$setup->endSetup();
}

Expand Down

0 comments on commit 770026c

Please sign in to comment.