80 lines
3.2 KiB
PHP
80 lines
3.2 KiB
PHP
<?php
|
|
/**
|
|
* 2007-2015 PrestaShop
|
|
*
|
|
* NOTICE OF LICENSE
|
|
*
|
|
* This source file is subject to the Academic Free License (AFL 3.0)
|
|
* that is bundled with this package in the file LICENSE.txt.
|
|
* It is also available through the world-wide-web at this URL:
|
|
* http://opensource.org/licenses/afl-3.0.php
|
|
* If you did not receive a copy of the license and are unable to
|
|
* obtain it through the world-wide-web, please send an email
|
|
* to license@prestashop.com so we can send you a copy immediately.
|
|
*
|
|
* 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.
|
|
*
|
|
* @author PrestaShop SA <contact@prestashop.com>
|
|
* @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;
|
|
}
|
|
}
|