Merge pull request #13745 from spencerrlongg/bug/table_prefix_migration_fix

Resolves issue with migrations with table prefixes
This commit is contained in:
snipe 2023-10-13 08:49:28 +01:00 committed by GitHub
commit b96e77268a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -48,7 +48,7 @@ class DenormalizedEolAndAddColumnForExplicitDateToAssets extends Migration
->whereNotNull('model_id') ->whereNotNull('model_id')
->join('models', 'assets.model_id', '=', 'models.id') ->join('models', 'assets.model_id', '=', 'models.id')
->update([ ->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)')
]); ]);
} }