* @copyright 2007-2022 PrestaShop SA and Contributors * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) * International Registered Trademark & Property of PrestaShop SA */ if (!defined('_PS_VERSION_')) { exit; } function upgrade_module_4_2_0($module) { return installDb() && $module->registerHook('actionProductSave') && $module->registerHook('actionProductDelete'); } function installDb() { return Db::getInstance()->execute( ' CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'doofinder_product` ( `id_doofinder_product` INT UNSIGNED NOT NULL AUTO_INCREMENT, `id_shop` INT(10) UNSIGNED NOT NULL, `id_product` INT(10) UNSIGNED NOT NULL, `action` VARCHAR(45) NOT NULL, `date_upd` DATETIME NOT NULL, PRIMARY KEY (`id_doofinder_product`), CONSTRAINT uc_shop_product UNIQUE KEY (id_shop,id_product) ) ENGINE=' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=utf8 ;' ); }