Skip to content

Commit dc19322

Browse files
committed
MAGETWO-40057: Create Grid Table
1 parent fe60ed7 commit dc19322

File tree

1 file changed

+26
-6
lines changed

1 file changed

+26
-6
lines changed

app/code/Magento/Customer/Setup/UpgradeData.php

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66

77
namespace Magento\Customer\Setup;
88

9-
use Magento\Framework\Module\Setup\Migration;
9+
use Magento\Customer\Model\Customer;
10+
use Magento\Framework\Indexer\IndexerRegistry;
1011
use Magento\Framework\Setup\UpgradeDataInterface;
1112
use Magento\Framework\Setup\ModuleContextInterface;
1213
use Magento\Framework\Setup\ModuleDataSetupInterface;
@@ -21,16 +22,31 @@ class UpgradeData implements UpgradeDataInterface
2122
*
2223
* @var CustomerSetupFactory
2324
*/
24-
private $customerSetupFactory;
25+
protected $customerSetupFactory;
26+
27+
/**
28+
* @var IndexerRegistry
29+
*/
30+
protected $indexerRegistry;
31+
32+
/**
33+
* @var \Magento\Eav\Model\Config
34+
*/
35+
protected $eavConfig;
2536

2637
/**
27-
* Init
28-
*
2938
* @param CustomerSetupFactory $customerSetupFactory
39+
* @param IndexerRegistry $indexerRegistry
40+
* @param \Magento\Eav\Model\Config $eavConfig
3041
*/
31-
public function __construct(CustomerSetupFactory $customerSetupFactory)
32-
{
42+
public function __construct(
43+
CustomerSetupFactory $customerSetupFactory,
44+
IndexerRegistry $indexerRegistry,
45+
\Magento\Eav\Model\Config $eavConfig
46+
) {
3347
$this->customerSetupFactory = $customerSetupFactory;
48+
$this->indexerRegistry = $indexerRegistry;
49+
$this->eavConfig = $eavConfig;
3450
}
3551

3652
/**
@@ -171,6 +187,10 @@ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface
171187
}
172188
}
173189

190+
$indexer = $this->indexerRegistry->get(Customer::CUSTOMER_GRID_INDEXER_ID);
191+
$indexer->reindexAll();
192+
$this->eavConfig->clear();
193+
174194
$setup->endSetup();
175195
}
176196
}

0 commit comments

Comments
 (0)