// fix upgrader drop index sql warning

This commit is contained in:
mMarinetti
2012-02-09 14:28:03 +00:00
parent 917126ca31
commit 638becc0c5
2 changed files with 45 additions and 2 deletions
@@ -0,0 +1,43 @@
<?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_id_shop_to_shipper_lang_index()
{
$res = true;
$key_exists = Db::getInstance()->executeS('SHOW INDEX
FROM `'._DB_PREFIX_.'carrier_lang`
WHERE Key_name = "shipper_lang_index"');
if ($key_exists)
$res &= Db::getInstance()->execute('ALTER TABLE
`'._DB_PREFIX_.'carrier_lang`
DROP KEY `shipper_lang_index`');
$res &= Db::getInstance()->execute('ALTER TABLE
`'._DB_PREFIX_.'carrier_lang`
ADD UNIQUE `shipper_lang_index` (`id_carrier`, `id_shop`, `id_lang`)');
return $res;
}
+2 -2
View File
@@ -279,8 +279,8 @@ 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`);
/* PHP:add_id_shop_to_shipper_lang_index(); */;
ALTER TABLE `PREFIX_search_word` ADD `id_shop` INT(11) NOT NULL DEFAULT '1' AFTER `id_word`;
ALTER TABLE `PREFIX_search_word` DROP INDEX `id_lang`, ADD UNIQUE `id_lang` (`id_lang`,`id_shop`,`word`);