mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-28 17:02:04 +03:00
Added a little protection to migration query
Just to be sure the query is filtered as expected to only affect shelf-based images.
This commit is contained in:
@ -22,11 +22,13 @@ class FixShelfCoverImageTypes extends Migration
|
||||
->pluck('image_id')
|
||||
->values()->all();
|
||||
|
||||
if (count($shelfImageIds) > 0) {
|
||||
DB::table('images')
|
||||
->where('type', '=', 'cover_book')
|
||||
->whereIn('id', $shelfImageIds)
|
||||
->update(['type' => 'cover_bookshelf']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
|
Reference in New Issue
Block a user