-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
⏫ Forwardport of #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. 7559783 2. b853497 3. be8b258 Fixed GitHub Issues in 2.3-develop branch: - #12787: Newsletter\Model\Subscriber::loadByEmail() does not use MySQL index (reported by @schmengler)
- Loading branch information
1 parent
8e77e2f
commit 54bc3a1
Showing
2 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\Newsletter\Setup; | ||
|
||
use Magento\Framework\Setup\ModuleContextInterface; | ||
use Magento\Framework\Setup\SchemaSetupInterface; | ||
use Magento\Framework\Setup\UpgradeSchemaInterface; | ||
|
||
/** | ||
* Upgrade the Newsletter module DB scheme | ||
*/ | ||
class UpgradeSchema implements UpgradeSchemaInterface | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context) | ||
{ | ||
$setup->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(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters