mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
use query builder instead of model for update to skip observer
This commit is contained in:
parent
42d35174b2
commit
0d853f931d
|
@ -36,10 +36,12 @@ class DenormalizedEolAndAddColumnForExplicitDateToAssets extends Migration
|
||||||
}
|
}
|
||||||
if ($asset->model->eol) {
|
if ($asset->model->eol) {
|
||||||
if ($months != $asset->model->eol) {
|
if ($months != $asset->model->eol) {
|
||||||
$asset->update(['eol_explicit' => true]);
|
DB::table('assets')->where('id', $asset->id)->update(['eol_explicit' => true]);
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
$asset->update(['eol_explicit' => true]);
|
// if there is NO model eol, but there is a purchase date and an asset_eol_date (which is what is left over) the asset_eol_date has still been explicitly set
|
||||||
|
else {
|
||||||
|
DB::table('assets')->where('id', $asset->id)->update(['eol_explicit' => true]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue