mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-26 06:04:08 -08:00
resolve issue with migrations with table prefixes
This commit is contained in:
parent
138ec33555
commit
9b53b0fedc
|
@ -42,13 +42,13 @@ class DenormalizedEolAndAddColumnForExplicitDateToAssets extends Migration
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
DB::table('assets')
|
DB::table( 'assets')
|
||||||
->whereNull('asset_eol_date')
|
->whereNull('asset_eol_date')
|
||||||
->whereNotNull('purchase_date')
|
->whereNotNull('purchase_date')
|
||||||
->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)')
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue