diff --git a/install-dev/upgrade/php/update_module_product_comments.php b/install-dev/upgrade/php/update_module_product_comments.php new file mode 100644 index 000000000..8b7e2bad3 --- /dev/null +++ b/install-dev/upgrade/php/update_module_product_comments.php @@ -0,0 +1,48 @@ + +* @copyright 2007-2012 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 update_module_product_comments() +{ + if (Db::getInstance()->getValue('SELECT `id_module` FROM `'._DB_PREFIX_.'module` WHERE `name`="productcomments"')) + { + Db::getInstance()->execute(' + CREATE TABLE IF NOT EXISTS `ps_product_comment_usefulness` ( + `id_product_comment` int(10) unsigned NOT NULL, + `id_customer` int(10) unsigned NOT NULL, + `usefulness` tinyint(1) unsigned NOT NULL, + PRIMARY KEY (`id_product_comment`, `id_customer`) + ) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8'); + + Db::getInstance()->execute(' + CREATE TABLE IF NOT EXISTS `ps_product_comment_report` ( + `id_product_comment` int(10) unsigned NOT NULL, + `id_customer` int(10) unsigned NOT NULL, + PRIMARY KEY (`id_product_comment`, `id_customer`) + ) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8'); + } +} + diff --git a/install-dev/upgrade/sql/1.5.0.12.sql b/install-dev/upgrade/sql/1.5.0.12.sql index a44c5d31e..e1ecb0961 100644 --- a/install-dev/upgrade/sql/1.5.0.12.sql +++ b/install-dev/upgrade/sql/1.5.0.12.sql @@ -30,6 +30,7 @@ ALTER TABLE `PREFIX_pagenotfound` ADD `id_shop_group` INT(10) AFTER `id_pagenotf /* PHP:add_new_groups('Non identifié', 'Unidentified'); */; /* PHP:editorial_update_multishop(); */; +/* PHP:update_module_product_comments(); */; ALTER TABLE `PREFIX_customer` ADD `id_risk` int(10) unsigned NOT NULL DEFAULT '1',