2017-08-28 17:32:14 +02:00

73 lines
2.2 KiB
PHP
Executable File

<?php
/**
* 2007-2016 PrestaShop
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @category Atos
* @package Atos
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2014 PrestaShop SA
* @license http://addons.prestashop.com/en/content/12-terms-and-conditions-of-use
* @link http://addons.prestashop.com/2376-coupons-discount-vouchers.html
* International Registered Trademark & Property of PrestaShop SA
*/
if (!defined('_PS_VERSION_')) {
exit;
}
/**
* Upgrade method from 3.x.x
*
* @param Object $object Module instance
*
* @return bool
**/
function upgrade_module_3_1_0($module)
{
$sql = '';
$currentController = Context::getContext()->controller;
try {
$sql = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'atos_validation_events` (
`id_validation_event` INT(11) NOT NULL AUTO_INCREMENT,
`data` TEXT,
`created_at` DATETIME DEFAULT NULL,
PRIMARY KEY (id_validation_event)
)ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8';
Db::getInstance()->execute($sql);
} catch (PrestaShopDatabaseException $e) {
$currentController->_errors[] = $module->l('Failed to create the table atos_validation_events. You will find details in the store\'s logs');
if (version_compare(_PS_VERSION_, '1.6.0.3', '>=')) {
PrestaShopLogger::addLog(
'Failed to create the table atos_validation_events.
The exception message is '.$e->__toString(),
4,
null,
'Atos',
isset($module->id) ? $module->id : null,
true
);
} else {
Logger::addLog(
'Failed to create the table atos_validation_events. The exception message is '.$e->__toString(),
4,
null,
'Atos',
isset($module->id) ? $module->id : null,
true
);
}
return false;
}
return true;
}