A free open source IT asset/license management system
refactor
spencerrlongg8c9961aba8ab
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.phpindex 15f54f4e05..86f1844fce 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@@ -55,8 +55,15 @@ class DenormalizedEolAndAddColumnForExplicitDateToAssets extends Migration// }// }// });- Asset::whereNull('asset_eol_date')->whereNotNull('purchase_date')->has('model')- ->update(['asset_eol_date' => DB::raw('LEFT JOIN models ON assets.model_id = models.id) DATE_ADD(purchase_date, INTERVAL models.eol MONTH)')]);+ // Asset::whereNull('asset_eol_date')->whereNotNull('purchase_date')->has('model')+ // ->update(['asset_eol_date' => DB::raw('LEFT JOIN models ON assets.model_id = models.id) DATE_ADD(purchase_date, INTERVAL models.eol MONTH)')]);+ DB::table('assets')+ ->whereNull('asset_eol_date')+ ->whereNotNull('purchase_date')+ ->join('models', 'assets.model_id', '=', 'models.id')+ ->update([+ 'asset_eol_date' => DB::raw('DATE_ADD(purchase_date, INTERVAL models.eol MONTH)')+ ]);}