// fix related to sql queries

This commit is contained in:
mMarinetti
2012-01-18 17:56:16 +00:00
parent d041dded26
commit c393edbd5b
5 changed files with 74 additions and 5 deletions
@@ -0,0 +1,36 @@
<?php
/*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 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/osl-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-2011 PrestaShop SA
* @version Release: $Revision$
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
function add_column_order_state_deleted_if_not_exists()
{
$column = Db::getInstance()->executeS('SHOW FIELDS FROM `'._DB_PREFIX_.'order_state` LIKE "deleted"');
error(Db::getInstance()->getMsgError());
if (empty($column))
return Db::getInstance()->execute('ALTER TABLE `PREFIX_order_state`
ADD COLUMN `deleted` tinyint(1) UNSIGNED NOT NULL default "0" AFTER `paid`');
return true;
}
@@ -0,0 +1,35 @@
<?php
/*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 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/osl-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-2011 PrestaShop SA
* @version Release: $Revision$
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
function add_column_orders_reference_if_not_exists()
{
$column = Db::getInstance()->executeS('SHOW FIELDS FROM `'._DB_PREFIX_.'orders` LIKE "reference"');
error(Db::getInstance()->getMsgError());
if (empty($column))
return Db::getInstance()->execute('ALTER TABLE `PREFIX_orders` ADD COLUMN `reference` varchar(9) AFTER `id_order`');
return true;
}
+1
View File
@@ -279,6 +279,7 @@ ALTER TABLE `PREFIX_module_group` DROP PRIMARY KEY;
ALTER TABLE `PREFIX_module_group` ADD PRIMARY KEY (`id_module`, `id_shop`, `id_group`);
ALTER TABLE `PREFIX_carrier_lang` ADD `id_shop` INT(11) UNSIGNED NOT NULL DEFAULT '1' AFTER `id_carrier`;
ALTER TABLE `PREFIX_carrier_lang` DROP KEY `shipper_lang_index`;
ALTER TABLE `PREFIX_carrier_lang` ADD UNIQUE `shipper_lang_index` (`id_carrier`, `id_shop`, `id_lang`);
ALTER TABLE `PREFIX_search_word` ADD `id_shop` INT(11) NOT NULL DEFAULT '1' AFTER `id_word`;
+1 -3
View File
@@ -65,8 +65,6 @@ ALTER TABLE `PREFIX_tax_rule`
ADD `behavior` INT NOT NULL AFTER `zipcode_to`,
ADD `description` VARCHAR( 100 ) NOT NULL AFTER `id_tax`;
ALTER TABLE `PREFIX_tax_rule` DROP INDEX tax_rule;
INSERT INTO `PREFIX_tax_rule`
(`id_tax_rules_group`, `id_country`, `id_state`, `id_tax`,
`behavior`, `zipcode_from`, `zipcode_to`, `id_county`,
@@ -531,7 +529,7 @@ ALTER TABLE `PREFIX_specific_price` DROP INDEX `id_product`;
ALTER TABLE `PREFIX_specific_price` ADD INDEX `id_product` (`id_product`, `id_product_attribute`, `id_shop`, `id_currency`, `id_country`, `id_group`, `from_quantity`, `from`, `to`);
ALTER TABLE `PREFIX_orders` ADD COLUMN `reference` varchar(9) AFTER `id_order`;
/* PHP:add_column_orders_reference_if_not_exists(); */;
ALTER TABLE `PREFIX_orders` ADD COLUMN `id_warehouse` int(10) unsigned DEFAULT 0 AFTER `id_carrier`;
ALTER TABLE `PREFIX_cart` ADD COLUMN `order_reference` varchar(9) AFTER `id_cart`;
+1 -2
View File
@@ -1,7 +1,6 @@
SET NAMES 'utf8';
ALTER TABLE `PREFIX_order_state` ADD COLUMN `deleted` tinyint(1) UNSIGNED NOT NULL default '0' AFTER `paid`;
/* PHP:add_column_order_state_deleted_if_not_exists(); */;
ALTER TABLE `PREFIX_category` ADD COLUMN `is_root_category` tinyint(1) NOT NULL default '0' AFTER `position`;