diff --git a/ps_emailsubscription.php b/ps_emailsubscription.php index 375734e..26cb08b 100644 --- a/ps_emailsubscription.php +++ b/ps_emailsubscription.php @@ -168,7 +168,9 @@ public function install() `http_referer` VARCHAR(255) NULL, `active` TINYINT(1) NOT NULL DEFAULT \'0\', `id_lang` int(10) NOT NULL DEFAULT \'0\', - PRIMARY KEY(`id`) + PRIMARY KEY(`id`), + KEY `email_shop` (`email`, `id_shop`), + KEY `active_shop` (`active`, `id_shop`) ) ENGINE=' . _MYSQL_ENGINE_ . ' default CHARSET=utf8'); } diff --git a/upgrade/upgrade-3.0.1.php b/upgrade/upgrade-3.0.1.php new file mode 100644 index 0000000..401d650 --- /dev/null +++ b/upgrade/upgrade-3.0.1.php @@ -0,0 +1,42 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) + */ +if (!defined('_PS_VERSION_')) { + exit; +} + +/** + * @param Module $module + * + * @return bool + */ +function upgrade_module_3_0_1($module) +{ + return Db::getInstance()->execute( + 'ALTER TABLE `' . _DB_PREFIX_ . 'emailsubscription` + ADD KEY `email_shop` (`email`, `id_shop`), + ADD KEY `active_shop` (`active`, `id_shop`)' + ); +}