update
This commit is contained in:
32
modules/empikmarketplace/upgrade/upgrade-1.1.0.php
Normal file
32
modules/empikmarketplace/upgrade/upgrade-1.1.0.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Empik\Marketplace\Cache\CacheClearer;
|
||||
use Empik\Marketplace\Utils\DbUtils;
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param EmpikMarketplace $object
|
||||
* @return bool
|
||||
*/
|
||||
function upgrade_module_1_1_0($object)
|
||||
{
|
||||
(new CacheClearer($object))->clear();
|
||||
|
||||
$result = true;
|
||||
|
||||
$sql = [];
|
||||
|
||||
$sql[] = ['product', 'empik_offer_price', 'DECIMAL(20, 2) NOT NULL DEFAULT 0'];
|
||||
$sql[] = ['product', 'empik_offer_price_reduced', 'DECIMAL(20, 2) NOT NULL DEFAULT 0'];
|
||||
$sql[] = ['product_attribute', 'empik_offer_price', 'DECIMAL(20, 2) NOT NULL DEFAULT 0'];
|
||||
$sql[] = ['product_attribute', 'empik_offer_price_reduced', 'DECIMAL(20, 2) NOT NULL DEFAULT 0'];
|
||||
|
||||
foreach ($sql as $query) {
|
||||
$result &= DbUtils::safeAddColumn($query[0], $query[1], $query[2]);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
Reference in New Issue
Block a user