From dc1932276b6d049cd8b3305288f15dfb3e18e3ec Mon Sep 17 00:00:00 2001 From: Sviatoslav Mankivskyi Date: Fri, 7 Aug 2015 12:56:30 +0300 Subject: [PATCH] MAGETWO-40057: Create Grid Table --- .../Magento/Customer/Setup/UpgradeData.php | 32 +++++++++++++++---- 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/Customer/Setup/UpgradeData.php b/app/code/Magento/Customer/Setup/UpgradeData.php index 79b5f3544f296..cb49ae067545d 100644 --- a/app/code/Magento/Customer/Setup/UpgradeData.php +++ b/app/code/Magento/Customer/Setup/UpgradeData.php @@ -6,7 +6,8 @@ namespace Magento\Customer\Setup; -use Magento\Framework\Module\Setup\Migration; +use Magento\Customer\Model\Customer; +use Magento\Framework\Indexer\IndexerRegistry; use Magento\Framework\Setup\UpgradeDataInterface; use Magento\Framework\Setup\ModuleContextInterface; use Magento\Framework\Setup\ModuleDataSetupInterface; @@ -21,16 +22,31 @@ class UpgradeData implements UpgradeDataInterface * * @var CustomerSetupFactory */ - private $customerSetupFactory; + protected $customerSetupFactory; + + /** + * @var IndexerRegistry + */ + protected $indexerRegistry; + + /** + * @var \Magento\Eav\Model\Config + */ + protected $eavConfig; /** - * Init - * * @param CustomerSetupFactory $customerSetupFactory + * @param IndexerRegistry $indexerRegistry + * @param \Magento\Eav\Model\Config $eavConfig */ - public function __construct(CustomerSetupFactory $customerSetupFactory) - { + public function __construct( + CustomerSetupFactory $customerSetupFactory, + IndexerRegistry $indexerRegistry, + \Magento\Eav\Model\Config $eavConfig + ) { $this->customerSetupFactory = $customerSetupFactory; + $this->indexerRegistry = $indexerRegistry; + $this->eavConfig = $eavConfig; } /** @@ -171,6 +187,10 @@ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface } } + $indexer = $this->indexerRegistry->get(Customer::CUSTOMER_GRID_INDEXER_ID); + $indexer->reindexAll(); + $this->eavConfig->clear(); + $setup->endSetup(); } }