From e09fe0b8acbfa101e4b87a19207e9587e2a66cf4 Mon Sep 17 00:00:00 2001 From: vAugagneur Date: Thu, 13 Sep 2012 13:05:40 +0000 Subject: [PATCH] //remove from upgrade update_module_mailalerts.php --- .../upgrade/php/update_module_mailalerts.php | 77 ------------------- install-dev/upgrade/sql/1.4.9.1.sql | 4 +- 2 files changed, 1 insertion(+), 80 deletions(-) delete mode 100644 install-dev/upgrade/php/update_module_mailalerts.php diff --git a/install-dev/upgrade/php/update_module_mailalerts.php b/install-dev/upgrade/php/update_module_mailalerts.php deleted file mode 100644 index cb831f7be..000000000 --- a/install-dev/upgrade/php/update_module_mailalerts.php +++ /dev/null @@ -1,77 +0,0 @@ - -* @copyright 2007-2012 PrestaShop SA -* @version Release: $Revision: 14012 $ -* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) -* International Registered Trademark & Property of PrestaShop SA -*/ - -function update_module_mailalerts() -{ - if (Db::getInstance()->getValue('SELECT id_module FROM `'._DB_PREFIX_.'module` WHERE name = \'mailalerts\'')) - { - $result = Db::getInstance()->Execute(' - CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'mailalert_customer_oos_new` ( - `id_customer` int(10) unsigned NOT NULL, - `customer_email` varchar(128) NOT NULL, - `id_product` int(10) unsigned NOT NULL, - `id_product_attribute` int(10) unsigned NOT NULL, - `id_lang` int(10) unsigned NOT NULL, - `date_add` datetime NOT NULL, - PRIMARY KEY (`id_customer`, `customer_email`, `id_product`, `id_product_attribute`, `id_lang`), - KEY `customer_email` (`customer_email`), - KEY `id_product` (`id_product`,`id_product_attribute`) - ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8;'); - - $default_language = (int)Configuration::get('PS_LANG_DEFAULT'); - $current_time = date('Y-m-d H:i:s'); - $existing_alerts = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'mailalert_customer_oos`', false); - $result &= (bool)$existing_alerts; - - if ($result) - { - $total_alerts = (int)Db::getInstance()->NumRows(); - while ($row = Db::getInstance()->nextRow($existing_alerts)) - { - if (!isset($row['id_lang'])) - $row['id_lang'] = $default_language; - if (!isset($row['date_add'])) - $row['date_add'] = $current_time; - - $result &= Db::getInstance()->AutoExecute(_DB_PREFIX_.'mailalert_customer_oos_new', $row, 'INSERT'); - } - - $total_new_alerts = (int)Db::getInstance()->getValue('SELECT COUNT(*) FROM `'._DB_PREFIX_.'mailalert_customer_oos_new`'); - - if ($result && $total_alerts == $total_new_alerts) - { - $result &= Db::getInstance()->Execute('DROP TABLE '._DB_PREFIX_.'mailalert_customer_oos'); - if ($result) - $result &= Db::getInstance()->Execute('RENAME TABLE '._DB_PREFIX_.'mailalert_customer_oos_new TO '._DB_PREFIX_.'mailalert_customer_oos'); - } - } - - return $result; - } - - return true; -} \ No newline at end of file diff --git a/install-dev/upgrade/sql/1.4.9.1.sql b/install-dev/upgrade/sql/1.4.9.1.sql index 7ba82b218..22c382dd4 100644 --- a/install-dev/upgrade/sql/1.4.9.1.sql +++ b/install-dev/upgrade/sql/1.4.9.1.sql @@ -1,3 +1 @@ -SET NAMES 'utf8'; - -/* PHP:update_module_mailalerts(); */; \ No newline at end of file +SET NAMES 'utf8'; \ No newline at end of file