From cc82e86eeb761437ce9c6cff575274c0950ab4d3 Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Wed, 4 Oct 2023 16:54:56 -0500 Subject: [PATCH] one more check --- ...normalized_eol_and_add_column_for_explicit_date_to_assets.php | 1 + 1 file changed, 1 insertion(+) 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 86f1844fce..a84688f773 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 @@ -60,6 +60,7 @@ class DenormalizedEolAndAddColumnForExplicitDateToAssets extends Migration DB::table('assets') ->whereNull('asset_eol_date') ->whereNotNull('purchase_date') + ->whereNotNull('model_id') ->join('models', 'assets.model_id', '=', 'models.id') ->update([ 'asset_eol_date' => DB::raw('DATE_ADD(purchase_date, INTERVAL models.eol MONTH)')