Skip to content

Commit

Permalink
Fix upgrade script to allow large customer database
Browse files Browse the repository at this point in the history
We kept running out of memory when trying to apply this upgrade script to a 250,000 customer site. This fix will activate customers 1000 at a time.

This PR is a cleaner version of #77
  • Loading branch information
j831 committed May 12, 2015
1 parent 167de94 commit d8be7c9
Showing 1 changed file with 4 additions and 3 deletions.
Expand Up @@ -29,7 +29,8 @@
->from($resource->getEntityTable(), $resource->getEntityIdField());
$customerIds = $installer->getConnection()->fetchCol($select);

$updatedCustomerIds = Mage::getResourceModel('customeractivation/customer')
->massSetActivationStatus($customerIds, 1);
foreach (array_chunk($customerIds,1000) as $updateIds) {
$updatedCustomerIds = Mage::getResourceModel('customeractivation/customer')->massSetActivationStatus($updateIds, 1);
}

$installer->endSetup();
$installer->endSetup();

0 comments on commit d8be7c9

Please sign in to comment.