@@ -60,6 +60,52 @@ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface
60
60
/** @var CustomerSetup $customerSetup */
61
61
$ customerSetup = $ this ->customerSetupFactory ->create (['setup ' => $ setup ]);
62
62
63
+ if (version_compare ($ context ->getVersion (), '2.0.6 ' , '< ' )) {
64
+ $ customerSetup ->updateEntityType (
65
+ \Magento \Customer \Model \Customer::ENTITY ,
66
+ 'entity_model ' ,
67
+ 'Magento\Customer\Model\ResourceModel\Customer '
68
+ );
69
+ $ customerSetup ->updateEntityType (
70
+ \Magento \Customer \Model \Customer::ENTITY ,
71
+ 'increment_model ' ,
72
+ 'Magento\Eav\Model\Entity\Increment\NumericValue '
73
+ );
74
+ $ customerSetup ->updateEntityType (
75
+ \Magento \Customer \Model \Customer::ENTITY ,
76
+ 'entity_attribute_collection ' ,
77
+ 'Magento\Customer\Model\ResourceModel\Attribute\Collection '
78
+ );
79
+ $ customerSetup ->updateEntityType (
80
+ 'customer_address ' ,
81
+ 'entity_model ' ,
82
+ 'Magento\Customer\Model\ResourceModel\Address '
83
+ );
84
+ $ customerSetup ->updateEntityType (
85
+ 'customer_address ' ,
86
+ 'entity_attribute_collection ' ,
87
+ 'Magento\Customer\Model\ResourceModel\Address\Attribute\Collection '
88
+ );
89
+ $ customerSetup ->updateAttribute (
90
+ 'customer_address ' ,
91
+ 'country_id ' ,
92
+ 'source_model ' ,
93
+ 'Magento\Customer\Model\ResourceModel\Address\Attribute\Source\Country '
94
+ );
95
+ $ customerSetup ->updateAttribute (
96
+ 'customer_address ' ,
97
+ 'region ' ,
98
+ 'backend_model ' ,
99
+ 'Magento\Customer\Model\ResourceModel\Address\Attribute\Backend\Region '
100
+ );
101
+ $ customerSetup ->updateAttribute (
102
+ 'customer_address ' ,
103
+ 'region_id ' ,
104
+ 'source_model ' ,
105
+ 'Magento\Customer\Model\ResourceModel\Address\Attribute\Source\Region '
106
+ );
107
+ }
108
+
63
109
if (version_compare ($ context ->getVersion (), '2.0.1 ' , '< ' )) {
64
110
$ entityAttributes = [
65
111
'customer ' => [
@@ -240,51 +286,6 @@ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface
240
286
];
241
287
$ this ->upgradeAttributes ($ entityAttributes , $ customerSetup );
242
288
}
243
- if (version_compare ($ context ->getVersion (), '2.0.6 ' , '< ' )) {
244
- $ customerSetup ->updateEntityType (
245
- \Magento \Customer \Model \Customer::ENTITY ,
246
- 'entity_model ' ,
247
- 'Magento\Customer\Model\ResourceModel\Customer '
248
- );
249
- $ customerSetup ->updateEntityType (
250
- \Magento \Customer \Model \Customer::ENTITY ,
251
- 'increment_model ' ,
252
- 'Magento\Eav\Model\Entity\Increment\NumericValue '
253
- );
254
- $ customerSetup ->updateEntityType (
255
- \Magento \Customer \Model \Customer::ENTITY ,
256
- 'entity_attribute_collection ' ,
257
- 'Magento\Customer\Model\ResourceModel\Attribute\Collection '
258
- );
259
- $ customerSetup ->updateEntityType (
260
- 'customer_address ' ,
261
- 'entity_model ' ,
262
- 'Magento\Customer\Model\ResourceModel\Address '
263
- );
264
- $ customerSetup ->updateEntityType (
265
- 'customer_address ' ,
266
- 'entity_attribute_collection ' ,
267
- 'Magento\Customer\Model\ResourceModel\Address\Attribute\Collection '
268
- );
269
- $ customerSetup ->updateAttribute (
270
- 'customer_address ' ,
271
- 'country_id ' ,
272
- 'source_model ' ,
273
- 'Magento\Customer\Model\ResourceModel\Address\Attribute\Source\Country '
274
- );
275
- $ customerSetup ->updateAttribute (
276
- 'customer_address ' ,
277
- 'region ' ,
278
- 'backend_model ' ,
279
- 'Magento\Customer\Model\ResourceModel\Address\Attribute\Backend\Region '
280
- );
281
- $ customerSetup ->updateAttribute (
282
- 'customer_address ' ,
283
- 'region_id ' ,
284
- 'source_model ' ,
285
- 'Magento\Customer\Model\ResourceModel\Address\Attribute\Source\Region '
286
- );
287
- }
288
289
289
290
if (version_compare ($ context ->getVersion (), '2.0.6 ' , '< ' )) {
290
291
$ setup ->getConnection ()->delete (
@@ -332,6 +333,9 @@ private function upgradeHash($setup)
332
333
333
334
$ customers = $ setup ->getConnection ()->fetchAll ($ select );
334
335
foreach ($ customers as $ customer ) {
336
+ if ($ customer ['password_hash ' ] === null ) {
337
+ continue ;
338
+ }
335
339
list ($ hash , $ salt ) = explode (Encryptor::DELIMITER , $ customer ['password_hash ' ]);
336
340
337
341
$ newHash = $ customer ['password_hash ' ];
0 commit comments