* @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; }