[-] Bo : Could not update mailarler 2.5 with id_mlang
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<module>
|
||||
<name>mailalerts</name>
|
||||
<displayName><![CDATA[Mail alerts]]></displayName>
|
||||
<version><![CDATA[2.4]]></version>
|
||||
<version><![CDATA[2.5]]></version>
|
||||
<description><![CDATA[Sends e-mail notifications to customers and merchants.]]></description>
|
||||
<author><![CDATA[PrestaShop]]></author>
|
||||
<tab><![CDATA[administration]]></tab>
|
||||
|
||||
@@ -6,24 +6,9 @@ if (!defined('_PS_VERSION_'))
|
||||
function upgrade_module_2_5($object)
|
||||
{
|
||||
return Db::getInstance()->execute('
|
||||
ALTER TABLE '._DB_PREFIX_.'mailalert_customer_oos
|
||||
ADD '.mailalerts_stripslashes_field('id_lang').' INT( 10 ) UNSIGNED NOT NULL ,
|
||||
ALTER TABLE `'._DB_PREFIX_.'mailalert_customer_oos`
|
||||
ADD `id_lang` INT( 10 ) UNSIGNED NOT NULL ,
|
||||
DROP PRIMARY KEY ,
|
||||
ADD PRIMARY KEY (
|
||||
'.mailalerts_stripslashes_field('id_customer').' ,
|
||||
'.mailalerts_stripslashes_field('customer_email').' ,
|
||||
'.mailalerts_stripslashes_field('id_product').' ,
|
||||
'.mailalerts_stripslashes_field('id_product_attribute').' ,
|
||||
'.mailalerts_stripslashes_field('id_shop').'
|
||||
)'
|
||||
);
|
||||
}
|
||||
|
||||
function mailalerts_stripslashes_field($field)
|
||||
{
|
||||
$quotes = array('"\\\'"', '"\'"');
|
||||
$dquotes = array('\'\\\\"\'', '\'"\'');
|
||||
$backslashes = array('"\\\\\\\\"', '"\\\\"');
|
||||
|
||||
return '`'.bqSQL($field).'` = replace(replace(replace(`'.bqSQL($field).'`, '.$quotes[0].', '.$quotes[1].'), '.$dquotes[0].', '.$dquotes[1].'), '.$backslashes[0].', '.$backslashes[1].')';
|
||||
ADD PRIMARY KEY (`id_customer` , `customer_email` , `id_product` , `id_product_attribute` , `id_shop`)
|
||||
');
|
||||
}
|
||||
Reference in New Issue
Block a user