-
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.
Newsletter Model Subcriber LoadByEmail does not
- Use MYSQL index - Add an Mysql Index key via upgrade Schema - files add at app/code/Magento/Newsletter/Setup/UpgradeScheme.php - Modified at app/code/Magento/Newsletter/etc/module.xml
- Loading branch information
1 parent
816ec39
commit 7559783
Showing
2 changed files
with
38 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,37 @@ | ||
<?php | ||
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 | ||
{ | ||
|
||
/** | ||
* Upgrades DB schema for a module | ||
* | ||
* @param SchemaSetupInterface $setup | ||
* @param ModuleContextInterface $context | ||
* @return void | ||
*/ | ||
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