From 54bc3a1dca861e11e46e12f5a15578e0cb7ceb6d Mon Sep 17 00:00:00 2001 From: Magento EngCom Team Date: Wed, 24 Jan 2018 12:16:49 -0600 Subject: [PATCH] :arrow_double_up: Forwardport of magento/magento2#13033 to 2.3-develop branch Applied pull request patch https://github.com/magento/magento2/pull/13033.patch (created by @devamitbera) based on commit(s): 1. 755978397a8d0bacbfe81f7240b1e3ff3b9b23af 2. b85349745c4a593306edf61dae2235cd96a0fcd2 3. be8b258b6a7ff406f099619c917e2001731f1157 Fixed GitHub Issues in 2.3-develop branch: - magento/magento2#12787: Newsletter\Model\Subscriber::loadByEmail() does not use MySQL index (reported by @schmengler) --- .../Newsletter/Setup/UpgradeSchema.php | 36 +++++++++++++++++++ app/code/Magento/Newsletter/etc/module.xml | 2 +- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 app/code/Magento/Newsletter/Setup/UpgradeSchema.php diff --git a/app/code/Magento/Newsletter/Setup/UpgradeSchema.php b/app/code/Magento/Newsletter/Setup/UpgradeSchema.php new file mode 100644 index 0000000000000..e7ce898de83a3 --- /dev/null +++ b/app/code/Magento/Newsletter/Setup/UpgradeSchema.php @@ -0,0 +1,36 @@ +startSetup(); + + if (version_compare($context->getVersion(), '2.0.1', '<')) { + $connection = $setup->getConnection(); + + $connection->addIndex( + $setup->getTable('newsletter_subscriber'), + $setup->getIdxName('newsletter_subscriber', ['subscriber_email']), + ['subscriber_email'] + ); + } + + $setup->endSetup(); + } +} diff --git a/app/code/Magento/Newsletter/etc/module.xml b/app/code/Magento/Newsletter/etc/module.xml index f338445225222..5da16a9a3e9ba 100644 --- a/app/code/Magento/Newsletter/etc/module.xml +++ b/app/code/Magento/Newsletter/etc/module.xml @@ -6,7 +6,7 @@ */ --> - +