This commit is contained in:
spencerrlongg 2023-10-04 14:37:18 -05:00
parent cb10c7af27
commit ad6b502005

View file

@ -23,7 +23,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 // Update the eol_explicit column with the value from asset_eol_date if it exists and is different from the calculated value
$assetsToUpdateEolExplicit = []; //$assetsToUpdateEolExplicit = [];
DB::transaction(function() { DB::transaction(function() {
Asset::whereNotNull('asset_eol_date')->with('model')->chunkById(500, function ($assetsWithEolDates) { Asset::whereNotNull('asset_eol_date')->with('model')->chunkById(500, function ($assetsWithEolDates) {
foreach ($assetsWithEolDates as $asset) { foreach ($assetsWithEolDates as $asset) {
@ -35,7 +35,7 @@ class DenormalizedEolAndAddColumnForExplicitDateToAssets extends Migration
} }
if ($asset->model->eol) { if ($asset->model->eol) {
if ($months != $asset->model->eol) { if ($months != $asset->model->eol) {
$assetToUpdateEolExplicit = $asset->id; //$assetToUpdateEolExplicit = $asset->id;
$asset->update(['eol_explicit' => true]); $asset->update(['eol_explicit' => true]);
} }
} else { } else {