From 9b53b0fedc53b011b23053228744c5265e17dd17 Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Thu, 12 Oct 2023 14:50:12 -0500 Subject: [PATCH 1/2] resolve issue with migrations with table prefixes --- ...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 8bceca535..ca067c3d4 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 @@ -42,13 +42,13 @@ class DenormalizedEolAndAddColumnForExplicitDateToAssets extends Migration } }); - DB::table('assets') + 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)') + 'asset_eol_date' => DB::raw('DATE_ADD(purchase_date, INTERVAL ' . DB::getTablePrefix() . 'models.eol MONTH)') ]); } From f3bd23da3da69bef2171d12e725d7a99305309ed Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Thu, 12 Oct 2023 14:53:17 -0500 Subject: [PATCH 2/2] rm whitespace --- ...ormalized_eol_and_add_column_for_explicit_date_to_assets.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ca067c3d4..8d3ca9682 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 @@ -42,7 +42,7 @@ class DenormalizedEolAndAddColumnForExplicitDateToAssets extends Migration } }); - DB::table( 'assets') + DB::table('assets') ->whereNull('asset_eol_date') ->whereNotNull('purchase_date') ->whereNotNull('model_id')