From 64a9859efd26b4f692e11bd3a4b8c5cfb16a97c1 Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Wed, 13 Sep 2023 17:58:33 -0500 Subject: [PATCH] cleanup --- app/Importer/ItemImporter.php | 1 - ...alized_eol_and_add_column_for_explicit_date_to_assets.php | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/Importer/ItemImporter.php b/app/Importer/ItemImporter.php index c966c9f3c9..4e53ef60b7 100644 --- a/app/Importer/ItemImporter.php +++ b/app/Importer/ItemImporter.php @@ -245,7 +245,6 @@ class ItemImporter extends Importer $this->log('Asset Model Updated'); return $asset_model->id; - // here } $this->log('No Matching Model, Creating a new one'); 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 d2a8bb97fb..04c1e70f99 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 - $assetsWithEolDates = Asset::whereNotNull('asset_eol_date')->chunk(100, function ($assetsWithEolDates) { + Asset::whereNotNull('asset_eol_date')->chunk(100, function ($assetsWithEolDates) { foreach ($assetsWithEolDates as $asset) { if ($asset->asset_eol_date && $asset->purchase_date) { $months = Carbon::parse($asset->asset_eol_date)->diffInMonths($asset->purchase_date); @@ -35,10 +35,9 @@ class DenormalizedEolAndAddColumnForExplicitDateToAssets extends Migration } } }); - unset($assetsWithEolDates); // Update the asset_eol_date column with the calculated value if it doesn't exist - $assets = Asset::whereNull('asset_eol_date')->chunk(100, function ($assets) { + Asset::whereNull('asset_eol_date')->chunk(100, function ($assets) { foreach ($assets as $asset) { $model = Asset::find($asset->id)->model; if (!empty($model->eol)) {