* @copyright 2019 idnovate.com * @license See above */ function upgrade_module_2_1_16() { Db::getInstance()->execute( "CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."quantity_discount_rule_cart_product` ( `id_cart` int(10) unsigned NOT NULL, `id_quantity_discount_rule` int(10) unsigned NOT NULL, `id_product` int(10) unsigned NOT NULL, `id_product_attribute` int(10) unsigned DEFAULT NULL, `quantity` int(10) unsigned DEFAULT NULL, KEY `id_cart_id_quantity_discount_rule` (`id_cart`,`id_quantity_discount_rule`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8" ); //Check if table exists $columnExists = Db::getInstance()->getRow( "SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '"._DB_NAME_."' AND TABLE_NAME = '"._DB_PREFIX_."quantity_discount_rule_cart' AND COLUMN_NAME = 'id_action_type';" ); if (!$columnExists) { Db::getInstance()->execute( "ALTER TABLE `"._DB_PREFIX_."quantity_discount_rule_cart` ADD `id_action_type` int(10) unsigned NULL;" ); } return true; }