From 44441ec7031a2c8e379cf92726f03f0aa820658d Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Thu, 14 Sep 2023 14:25:02 -0500 Subject: [PATCH] up chunk size --- ...malized_eol_and_add_column_for_explicit_date_to_assets.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php b/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php index ddcf96bb79..60bca98b73 100644 --- a/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php +++ b/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php @@ -21,7 +21,7 @@ class DenormalizedEolAndAddColumnForExplicitDateToAssets extends Migration // Update the eol_explicit column with the value from asset_eol_date if it exists and is different from the calculated value - Asset::whereNotNull('asset_eol_date')->chunk(100, function ($assetsWithEolDates) { + Asset::whereNotNull('asset_eol_date')->chunk(500, function ($assetsWithEolDates) { foreach ($assetsWithEolDates as $asset) { if ($asset->asset_eol_date && $asset->purchase_date) { $months = CarbonImmutable::parse($asset->asset_eol_date)->diffInMonths($asset->purchase_date); @@ -37,7 +37,7 @@ class DenormalizedEolAndAddColumnForExplicitDateToAssets extends Migration }); // Update the asset_eol_date column with the calculated value if it doesn't exist - Asset::whereNull('asset_eol_date')->chunk(100, function ($assets) { + Asset::whereNull('asset_eol_date')->chunk(500, function ($assets) { foreach ($assets as $asset) { $model = Asset::find($asset->id)->model; if (!empty($model->eol)) {