* @copyright 2007-2015 PrestaShop SA * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ $sql = array(); $sql[] = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'ws_coupons` ( `id_ws_couponspro` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id_ws_couponspro`) ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8;'; /* $sql[] = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'ws_coupons_loyalty` ( `id_loyalty` INT UNSIGNED NOT NULL AUTO_INCREMENT, `id_loyalty_state` INT UNSIGNED NOT NULL DEFAULT 1, `id_customer` INT UNSIGNED NOT NULL, `id_order` INT UNSIGNED DEFAULT NULL, `id_cart_rule` INT UNSIGNED DEFAULT NULL, `points` INT NOT NULL DEFAULT 0, `date_add` DATETIME NOT NULL, `date_upd` DATETIME NOT NULL, PRIMARY KEY (`id_loyalty`), INDEX index_loyalty_loyalty_state (`id_loyalty_state`), INDEX index_loyalty_order (`id_order`), INDEX index_loyalty_discount (`id_cart_rule`), INDEX index_loyalty_customer (`id_customer`) ) DEFAULT CHARSET=utf8 ;'; $sql[] = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'ws_coupons_loyalty_history` ( `id_loyalty_history` INT UNSIGNED NOT NULL AUTO_INCREMENT, `id_loyalty` INT UNSIGNED DEFAULT NULL, `id_loyalty_state` INT UNSIGNED NOT NULL DEFAULT 1, `points` INT NOT NULL DEFAULT 0, `date_add` DATETIME NOT NULL, PRIMARY KEY (`id_loyalty_history`), INDEX `index_loyalty_history_loyalty` (`id_loyalty`), INDEX `index_loyalty_history_loyalty_state` (`id_loyalty_state`) ) DEFAULT CHARSET=utf8 ;'; $sql[] = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'ws_coupons_loyalty_state` ( `id_loyalty_state` INT UNSIGNED NOT NULL AUTO_INCREMENT, `id_order_state` INT UNSIGNED DEFAULT NULL, PRIMARY KEY (`id_loyalty_state`), INDEX index_loyalty_state_order_state (`id_order_state`) ) DEFAULT CHARSET=utf8 ;'; $sql[] = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'ws_coupons_loyalty_state_lang` ( `id_loyalty_state` INT UNSIGNED NOT NULL AUTO_INCREMENT, `id_lang` INT UNSIGNED NOT NULL, `name` varchar(64) NOT NULL, UNIQUE KEY `index_unique_loyalty_state_lang` (`id_loyalty_state`,`id_lang`) ) DEFAULT CHARSET=utf8 ;'; */ foreach ($sql as $query) { if (Db::getInstance()->execute($query) == false) { return false; } }