first commit
This commit is contained in:
18
modules/x13import/upgrade/install-3.9.0.php
Normal file
18
modules/x13import/upgrade/install-3.9.0.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once (dirname(__FILE__) . '/../x13import.php');
|
||||
|
||||
/**
|
||||
* @param $module x13import
|
||||
* @return bool
|
||||
*/
|
||||
function upgrade_module_3_9_0($module)
|
||||
{
|
||||
$module->reinstallTabs();
|
||||
|
||||
return true;
|
||||
}
|
||||
51
modules/x13import/upgrade/install-4.0.0.php
Normal file
51
modules/x13import/upgrade/install-4.0.0.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once (dirname(__FILE__) . '/../x13import.php');
|
||||
|
||||
/**
|
||||
* @param $module x13import
|
||||
* @return bool
|
||||
*/
|
||||
function upgrade_module_4_0_0($module)
|
||||
{
|
||||
// generate new class_index
|
||||
XImportAutoLoader::getInstance()
|
||||
->generateClassIndex()
|
||||
->autoload();
|
||||
|
||||
$module->reinstallTabs();
|
||||
|
||||
$path = _PS_MODULE_DIR_ . 'x13import/controllers/admin/';
|
||||
$dir = dir($path);
|
||||
|
||||
// usuwamy stare kontrolery
|
||||
while (false !== ($file = $dir->read())) {
|
||||
if (preg_match('/^((?!Controller).)*\.php$/', $file)) {
|
||||
@unlink($path . $file);
|
||||
}
|
||||
}
|
||||
|
||||
// usuwamy stare klasy i pliki
|
||||
@unlink(_PS_MODULE_DIR_ . 'x13import/classes/XImportThreshold.php');
|
||||
@unlink(_PS_MODULE_DIR_ . 'x13import/classes/XImportExclude.php');
|
||||
@unlink(_PS_MODULE_DIR_ . 'x13import/js/ximport.js');
|
||||
@rmdir(_PS_MODULE_DIR_ . 'x13import/js');
|
||||
|
||||
// nowe opcje w konfiguracji
|
||||
foreach (array(
|
||||
'UPDATE_DESC_SHORT' => XImportConfiguration::get('UPDATE_DESC'),
|
||||
'UPDATE_WHOLESALE_PRICE' => XImportConfiguration::get('UPDATE_PRICE'),
|
||||
'DISABLE_NO_IMAGES' => 0,
|
||||
'MAX_IMAGE_SIZE' => 5,
|
||||
'MAX_IMAGE_PIXEL' => 4500
|
||||
) as $key => $value
|
||||
) {
|
||||
XImportConfiguration::updateValue($key, $value);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
27
modules/x13import/upgrade/install-4.0.4.php
Normal file
27
modules/x13import/upgrade/install-4.0.4.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once (dirname(__FILE__) . '/../x13import.php');
|
||||
|
||||
/**
|
||||
* @param $module x13import
|
||||
* @return bool
|
||||
*/
|
||||
function upgrade_module_4_0_4($module)
|
||||
{
|
||||
// generate new class_index
|
||||
XImportAutoLoader::getInstance()
|
||||
->generateClassIndex()
|
||||
->autoload();
|
||||
|
||||
// nowe opcje w konfiguracji
|
||||
XImportConfiguration::updateValue('ALLOW_NO_IMAGES', 1);
|
||||
|
||||
return Db::getInstance()->execute('
|
||||
ALTER TABLE `' . _DB_PREFIX_ . 'ximport_item`
|
||||
ADD `carriers` text NULL;'
|
||||
);
|
||||
}
|
||||
46
modules/x13import/upgrade/install-4.1.0.php
Normal file
46
modules/x13import/upgrade/install-4.1.0.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once (dirname(__FILE__) . '/../x13import.php');
|
||||
|
||||
/**
|
||||
* @param $module x13import
|
||||
* @return bool
|
||||
*/
|
||||
function upgrade_module_4_1_0($module)
|
||||
{
|
||||
$pairs = Db::getInstance()->executeS('
|
||||
SELECT CONCAT(`id_ximport_category`, ".", `id_category`) AS pair, count(*) AS total
|
||||
FROM `' . _DB_PREFIX_ . 'ximport_category_additional`
|
||||
GROUP BY `pair`
|
||||
HAVING `total` > 1
|
||||
ORDER BY `total` DESC'
|
||||
);
|
||||
|
||||
foreach ($pairs as $row)
|
||||
{
|
||||
$pair = explode(".", $row['pair']);
|
||||
|
||||
Db::getInstance()->execute('
|
||||
DELETE FROM `' . _DB_PREFIX_ . 'ximport_category_additional`
|
||||
WHERE `id_ximport_category` = ' . (int)$pair[0] . '
|
||||
AND `id_category` = ' . (int)$pair[1]
|
||||
);
|
||||
|
||||
Db::getInstance()->execute('
|
||||
INSERT INTO `' . _DB_PREFIX_ . 'ximport_category_additional`
|
||||
(`id_ximport_category`, `id_category`)
|
||||
VALUES (' . (int)$pair[0] . ', ' . (int)$pair[1] . ')'
|
||||
);
|
||||
}
|
||||
|
||||
Db::getInstance()->execute('
|
||||
ALTER TABLE `' . _DB_PREFIX_ . 'ximport_category_additional` DROP INDEX `category`;
|
||||
ALTER TABLE `' . _DB_PREFIX_ . 'ximport_category_additional` ADD UNIQUE KEY `category` (`id_ximport_category`, `id_category`);'
|
||||
);
|
||||
|
||||
return true;
|
||||
}
|
||||
39
modules/x13import/upgrade/install-4.1.2.php
Normal file
39
modules/x13import/upgrade/install-4.1.2.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once (dirname(__FILE__) . '/../x13import.php');
|
||||
|
||||
/**
|
||||
* @param $module x13import
|
||||
* @return bool
|
||||
*/
|
||||
function upgrade_module_4_1_2($module)
|
||||
{
|
||||
Db::getInstance()->execute('
|
||||
ALTER TABLE `' . _DB_PREFIX_ . 'ximport_tmp`
|
||||
ADD `basic_wholesale_price` decimal(20,6) NOT NULL DEFAULT 0,
|
||||
ADD `basic_weight` decimal(20,6) NOT NULL DEFAULT 0;'
|
||||
);
|
||||
|
||||
$products = Db::getInstance()->executeS('
|
||||
SELECT `id_ximport_product`, `code`
|
||||
FROM `' . _DB_PREFIX_ . 'ximport_product`
|
||||
WHERE `id_product_attribute` = 0
|
||||
AND (`fingerprint` = "" OR `fingerprint` IS NULL)'
|
||||
);
|
||||
|
||||
if ($products) {
|
||||
foreach ($products as $product) {
|
||||
Db::getInstance()->execute('
|
||||
UPDATE `' . _DB_PREFIX_ . 'ximport_product`
|
||||
SET `fingerprint` = "' . pSQL(md5($product['code'] . serialize(array()))) . '"
|
||||
WHERE `id_ximport_product` = ' . (int)$product['id_ximport_product']
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
21
modules/x13import/upgrade/install-4.2.0.php
Normal file
21
modules/x13import/upgrade/install-4.2.0.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once (dirname(__FILE__) . '/../x13import.php');
|
||||
|
||||
/**
|
||||
* @param $module x13import
|
||||
* @return bool
|
||||
*/
|
||||
function upgrade_module_4_2_0($module)
|
||||
{
|
||||
Db::getInstance()->execute('
|
||||
ALTER TABLE `' . _DB_PREFIX_ . 'ximport_item`
|
||||
ADD `images_data` TEXT NOT NULL'
|
||||
);
|
||||
|
||||
return true;
|
||||
}
|
||||
21
modules/x13import/upgrade/install-4.2.4.php
Normal file
21
modules/x13import/upgrade/install-4.2.4.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once (dirname(__FILE__) . '/../x13import.php');
|
||||
|
||||
/**
|
||||
* @param $module x13import
|
||||
* @return bool
|
||||
*/
|
||||
function upgrade_module_4_2_4($module)
|
||||
{
|
||||
// generate new class_index
|
||||
XImportAutoLoader::getInstance()
|
||||
->generateClassIndex()
|
||||
->autoload();
|
||||
|
||||
return XImportConfiguration::updateValue('CLEAR_CACHE', 1);
|
||||
}
|
||||
19
modules/x13import/upgrade/install-4.3.0.php
Normal file
19
modules/x13import/upgrade/install-4.3.0.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once (dirname(__FILE__) . '/../x13import.php');
|
||||
|
||||
/**
|
||||
* @param $module x13import
|
||||
* @return bool
|
||||
*/
|
||||
function upgrade_module_4_3_0($module)
|
||||
{
|
||||
return Db::getInstance()->execute('
|
||||
ALTER TABLE `' . _DB_PREFIX_ . 'ximport_item`
|
||||
ADD `isbn` varchar(32) AFTER ean13'
|
||||
);
|
||||
}
|
||||
20
modules/x13import/upgrade/install-4.3.1.php
Normal file
20
modules/x13import/upgrade/install-4.3.1.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once (dirname(__FILE__) . '/../x13import.php');
|
||||
|
||||
/**
|
||||
* @param $module x13import
|
||||
* @return bool
|
||||
*/
|
||||
function upgrade_module_4_3_1($module)
|
||||
{
|
||||
return Db::getInstance()->execute('
|
||||
ALTER TABLE `' . _DB_PREFIX_ . 'ximport_tmp`
|
||||
ADD `max_out_of_stock` tinyint(1) UNSIGNED AFTER quantity,
|
||||
ADD `min_out_of_stock` tinyint(1) UNSIGNED AFTER quantity'
|
||||
);
|
||||
}
|
||||
28
modules/x13import/upgrade/install-4.3.3.php
Normal file
28
modules/x13import/upgrade/install-4.3.3.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once (dirname(__FILE__) . '/../x13import.php');
|
||||
|
||||
/**
|
||||
* @param $module x13import
|
||||
* @return bool
|
||||
*/
|
||||
function upgrade_module_4_3_3($module)
|
||||
{
|
||||
return Db::getInstance()->execute('
|
||||
ALTER TABLE `' . _DB_PREFIX_ . 'ximport_item`
|
||||
MODIFY `code` VARCHAR(128)'
|
||||
) && Db::getInstance()->execute('
|
||||
ALTER TABLE `' . _DB_PREFIX_ . 'ximport_item_image`
|
||||
MODIFY `code` VARCHAR(128)'
|
||||
) && Db::getInstance()->execute('
|
||||
ALTER TABLE `' . _DB_PREFIX_ . 'ximport_image`
|
||||
MODIFY `code` VARCHAR(128)'
|
||||
) && Db::getInstance()->execute('
|
||||
ALTER TABLE `' . _DB_PREFIX_ . 'ximport_product`
|
||||
MODIFY `code` VARCHAR(128)'
|
||||
);
|
||||
}
|
||||
20
modules/x13import/upgrade/install-4.3.5.php
Normal file
20
modules/x13import/upgrade/install-4.3.5.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once (dirname(__FILE__) . '/../x13import.php');
|
||||
|
||||
/**
|
||||
* @param $module x13import
|
||||
* @return bool
|
||||
*/
|
||||
function upgrade_module_4_3_5($module)
|
||||
{
|
||||
return Db::getInstance()->execute('
|
||||
ALTER TABLE `' . _DB_PREFIX_ . 'ximport_item`
|
||||
ADD `visibility_num` tinyint(1) NOT NULL DEFAULT 1 AFTER `visibility`,
|
||||
ADD `auction_id` bigint(20) NOT NULL DEFAULT 0;'
|
||||
);
|
||||
}
|
||||
147
modules/x13import/upgrade/install-4.4.0.php
Normal file
147
modules/x13import/upgrade/install-4.4.0.php
Normal file
@@ -0,0 +1,147 @@
|
||||
<?php
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once (dirname(__FILE__) . '/../x13import.php');
|
||||
|
||||
use x13import\Adapter\DbAdapter;
|
||||
use x13import\Wholesaler\WholesalerConfiguration;
|
||||
|
||||
/**
|
||||
* @param $module x13import
|
||||
* @return bool
|
||||
*/
|
||||
function upgrade_module_4_4_0($module)
|
||||
{
|
||||
// generate new class_index
|
||||
XImportAutoLoader::getInstance()
|
||||
->generateClassIndex()
|
||||
->autoload();
|
||||
|
||||
$module->reinstallTabs();
|
||||
|
||||
$dbCharset = DbAdapter::getUtf8Collation();
|
||||
|
||||
Db::getInstance()->execute('
|
||||
CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'ximport_configuration_wholesaler` (
|
||||
`wholesaler` varchar(64) NOT NULL,
|
||||
`value` text NOT NULL,
|
||||
|
||||
PRIMARY KEY (`wholesaler`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=' . $dbCharset . ';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'ximport_attachment` (
|
||||
`id_ximport_attachment` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`code` varchar(128) NOT NULL,
|
||||
`id_product` int(10) unsigned NOT NULL,
|
||||
`id_attachment` int(10) unsigned NOT NULL,
|
||||
`fingerprint` varchar(32) NOT NULL,
|
||||
|
||||
PRIMARY KEY (`id_ximport_attachment`),
|
||||
INDEX (`code`),
|
||||
INDEX (`id_product`),
|
||||
INDEX (`id_attachment`),
|
||||
INDEX (`fingerprint`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=' . $dbCharset . ';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'ximport_item_attachment` (
|
||||
`id_ximport_item_attachment` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`code` varchar(128) NOT NULL,
|
||||
`type` varchar(10) NOT NULL,
|
||||
`value` mediumtext NOT NULL,
|
||||
`value_md5` varchar(32) NOT NULL,
|
||||
`fingerprint` varchar(32) NULL,
|
||||
|
||||
PRIMARY KEY (`id_ximport_item_attachment`),
|
||||
UNIQUE INDEX (`code`, `value_md5`),
|
||||
INDEX (`code`),
|
||||
INDEX (`value_md5`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=' . $dbCharset . ';
|
||||
|
||||
ALTER TABLE `' . _DB_PREFIX_ . 'ximport_item`
|
||||
ADD `unit_price` decimal(20,6) NOT NULL DEFAULT "0.00" AFTER `price`,
|
||||
ADD `mpn` varchar(40) NOT NULL DEFAULT "" AFTER `ean13`,
|
||||
ADD `is_virtual` tinyint(1) NOT NULL DEFAULT 0 AFTER `on_sale`,
|
||||
ADD `additional_shipping_cost` decimal(20,6) NOT NULL DEFAULT "0.00" AFTER `wholesale_price`,
|
||||
ADD `delivery_in_stock` varchar(255) NOT NULL DEFAULT "" AFTER `available_later`,
|
||||
ADD `delivery_out_stock` varchar(255) NOT NULL DEFAULT "" AFTER `available_later`;
|
||||
|
||||
ALTER TABLE `' . _DB_PREFIX_ . 'ximport_tmp`
|
||||
ADD `product_unit_price` decimal(20,6) NOT NULL DEFAULT "0.00" AFTER `max_out_of_stock`,
|
||||
ADD `basic_unit_price` decimal(20,6) NOT NULL DEFAULT "0.00" AFTER `basic_price`;'
|
||||
);
|
||||
|
||||
if ($dbCharset == 'utf8mb4') {
|
||||
Db::getInstance()->execute('
|
||||
ALTER TABLE `' . _DB_PREFIX_ . 'ximport_item` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;'
|
||||
);
|
||||
}
|
||||
|
||||
$configuration = [];
|
||||
$configurationDefault = array_keys(XImportConfiguration::getDefaultConfiguration());
|
||||
$configurationTable = Db::getInstance()->executeS('
|
||||
SELECT `name`, `value`
|
||||
FROM `' . _DB_PREFIX_ . 'ximport_configuration`'
|
||||
);
|
||||
|
||||
foreach ($configurationTable as $row) {
|
||||
$configuration[$row['name']] = $row['value'];
|
||||
}
|
||||
|
||||
foreach (XImportWholesalers::getWholesalers() as $wholesaler) {
|
||||
$wholesalerOptions = new WholesalerConfiguration($wholesaler['name']);
|
||||
|
||||
/** @var XImportWholesalers $className */
|
||||
$className = XImportWholesalers::getWholesalerClassName($wholesaler['name']);
|
||||
$wholesalerCustomFields = array_column($className::getCustomFields(), 'name');
|
||||
|
||||
// default configuration
|
||||
foreach ($wholesalerCustomFields as $customField) {
|
||||
if (isset($configuration[$customField])) {
|
||||
$wholesalerOptions->{$customField} = $configuration[$customField];
|
||||
}
|
||||
}
|
||||
|
||||
// advanced configuration
|
||||
if (isset($configuration['ADVANCED_CARRIERS']) && $configuration['ADVANCED_CARRIERS']) {
|
||||
$wholesalerOptions->ADDITIONAL_OPTION_ENABLED = 1;
|
||||
}
|
||||
if ((isset($configuration['ADVANCED_AFTER_CRON_BLOCK']) && $configuration['ADVANCED_AFTER_CRON_BLOCK'])
|
||||
|| (isset($configuration['ADVANCED_STOCK']) && $configuration['ADVANCED_STOCK'])
|
||||
) {
|
||||
$wholesalerOptions->IMPORT_RESTRICTION_ENABLED = 1;
|
||||
}
|
||||
|
||||
// individual advanced configuration
|
||||
if (isset($configuration[$wholesaler['name'] . '_ADV_STOCK']) && $configuration[$wholesaler['name'] . '_ADV_STOCK']) {
|
||||
$wholesalerOptions->IMPORT_RESTRICTION_STOCK_ZERO = (int)$configuration[$wholesaler['name'] . '_ADV_STOCK'];
|
||||
}
|
||||
if (isset($configuration[$wholesaler['name'] . '_ADV_CRON_BLOCK']) && $configuration[$wholesaler['name'] . '_ADV_CRON_BLOCK']) {
|
||||
$wholesalerOptions->IMPORT_RESTRICTION_CRON_BLOCK = (int)$configuration[$wholesaler['name'] . '_ADV_CRON_BLOCK'];
|
||||
}
|
||||
if (isset($configuration[$wholesaler['name'] . '_ADV_CARRIERS']) && $configuration[$wholesaler['name'] . '_ADV_CARRIERS']) {
|
||||
$wholesalerOptions->ADDITIONAL_OPTION_CARRIERS = explode(',', $configuration[$wholesaler['name'] . '_ADV_CARRIERS']);
|
||||
}
|
||||
|
||||
$wholesalerOptions->saveConfiguration();
|
||||
}
|
||||
|
||||
// remove unnecessary configuration values from database
|
||||
foreach (array_keys($configuration) as $conf) {
|
||||
if (!in_array($conf, $configurationDefault)) {
|
||||
XImportConfiguration::deleteByName($conf);
|
||||
}
|
||||
}
|
||||
|
||||
$newConfig = [
|
||||
'USE_TOKEN' => 0,
|
||||
'TOKEN' => Tools::passwdGen()
|
||||
];
|
||||
foreach ($newConfig as $conf => $value) {
|
||||
XImportConfiguration::updateValue($conf, $value);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
39
modules/x13import/upgrade/install-4.5.0.php
Normal file
39
modules/x13import/upgrade/install-4.5.0.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once (dirname(__FILE__) . '/../x13import.php');
|
||||
|
||||
use x13import\Adapter\DbAdapter;
|
||||
|
||||
/**
|
||||
* @param $module x13import
|
||||
* @return bool
|
||||
*/
|
||||
function upgrade_module_4_5_0()
|
||||
{
|
||||
$dbCharset = DbAdapter::getUtf8Collation();
|
||||
|
||||
if ('utf8mb4' == $dbCharset) {
|
||||
Db::getInstance()->execute(
|
||||
'
|
||||
ALTER TABLE `'._DB_PREFIX_.'ximport_configuration` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
|
||||
ALTER TABLE `'._DB_PREFIX_.'ximport_configuration_wholesaler` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
|
||||
ALTER TABLE `'._DB_PREFIX_.'ximport_price` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
|
||||
ALTER TABLE `'._DB_PREFIX_.'ximport_category` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
|
||||
ALTER TABLE `'._DB_PREFIX_.'ximport_category_additional` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
|
||||
ALTER TABLE `'._DB_PREFIX_.'ximport_image` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
|
||||
ALTER TABLE `'._DB_PREFIX_.'ximport_image_attribute` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
|
||||
ALTER TABLE `'._DB_PREFIX_.'ximport_attachment` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
|
||||
ALTER TABLE `'._DB_PREFIX_.'ximport_item_image` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
|
||||
ALTER TABLE `'._DB_PREFIX_.'ximport_item_attachment` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
|
||||
ALTER TABLE `'._DB_PREFIX_.'ximport_tmp` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
|
||||
ALTER TABLE `'._DB_PREFIX_.'ximport_product` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
|
||||
'
|
||||
);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
20
modules/x13import/upgrade/install-4.7.1.php
Normal file
20
modules/x13import/upgrade/install-4.7.1.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once (dirname(__FILE__) . '/../x13import.php');
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
function upgrade_module_4_7_1()
|
||||
{
|
||||
// generate new class_index
|
||||
XImportAutoLoader::getInstance()
|
||||
->generateClassIndex()
|
||||
->autoload();
|
||||
|
||||
return true;
|
||||
}
|
||||
28
modules/x13import/upgrade/install-4.7.2.php
Normal file
28
modules/x13import/upgrade/install-4.7.2.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once (dirname(__FILE__) . '/../x13import.php');
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
function upgrade_module_4_7_2()
|
||||
{
|
||||
// fingerprint fix
|
||||
XImportConfiguration::updateValue('FINGERPRINT_REGENERATION_472', 1);
|
||||
|
||||
// clear all item tables
|
||||
Db::getInstance()->execute('TRUNCATE TABLE `' . _DB_PREFIX_ . 'ximport_item`');
|
||||
Db::getInstance()->execute('TRUNCATE TABLE `' . _DB_PREFIX_ . 'ximport_item_image`');
|
||||
|
||||
Db::getInstance()->execute('
|
||||
ALTER TABLE `' . _DB_PREFIX_ . 'ximport_item`
|
||||
ADD `fingerprint_old` varchar(32) NOT NULL AFTER `fingerprint`,
|
||||
ADD INDEX(`fingerprint_old`);'
|
||||
);
|
||||
|
||||
return true;
|
||||
}
|
||||
20
modules/x13import/upgrade/install-4.7.3.php
Normal file
20
modules/x13import/upgrade/install-4.7.3.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once (dirname(__FILE__) . '/../x13import.php');
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
function upgrade_module_4_7_3()
|
||||
{
|
||||
Db::getInstance()->execute('
|
||||
ALTER TABLE `' . _DB_PREFIX_ . 'ximport_category`
|
||||
ADD `markup_type` ENUM("percent", "amount") NOT NULL DEFAULT "percent" AFTER `markup`;'
|
||||
);
|
||||
|
||||
return true;
|
||||
}
|
||||
Reference in New Issue
Block a user