mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 05:04:07 -08:00
Added comments
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
b2aed7feea
commit
2537d0fdaf
|
@ -129,7 +129,8 @@ class AssetObserver
|
|||
*
|
||||
* For example, if there is a database migration that's a bit older and modifies an asset, if the save
|
||||
* fires before a field gets created in a later migration and that field in the later migration
|
||||
* is used in this observer, it doesn't actually exist yet and the migration will break.
|
||||
* is used in this observer, it doesn't actually exist yet and the migration will break unless we
|
||||
* use saveQuietly() in the migration which skips this observer.
|
||||
*
|
||||
* @see https://github.com/snipe/snipe-it/issues/13723#issuecomment-1761315938
|
||||
*/
|
||||
|
|
|
@ -23,6 +23,8 @@ class AddEolDateOnAssetsTable extends Migration
|
|||
});
|
||||
|
||||
// Chunk the model query to get the models that do have an EOL date
|
||||
// We use saveQuietly() here to skip the AssetObserver, since it modifies fields
|
||||
// that do not yet exist on the assets table.
|
||||
AssetModel::whereNotNull('eol')->chunk(10, function ($models) {
|
||||
foreach ($models as $model) {
|
||||
foreach ($model->assets as $asset) {
|
||||
|
|
Loading…
Reference in a new issue