Skip to content

Commit fff1001

Browse files
kaitlinnewsonasmecher
authored andcommitted
pkp/pkp-lib#10511 fix postgres upgrade error for migration
1 parent 59aad9c commit fff1001

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

classes/migration/upgrade/v3_5_0/I10511_RemoveSeriesMenuItems.php

+5-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
namespace APP\migration\upgrade\v3_5_0;
1616

17-
use Illuminate\Database\Query\Builder;
1817
use Illuminate\Support\Facades\DB;
1918
use PKP\install\DowngradeNotSupportedException;
2019
use PKP\migration\Migration;
@@ -26,11 +25,13 @@ class I10511_RemoveSeriesMenuItems extends Migration
2625
*/
2726
public function up(): void
2827
{
28+
$seriesIds = DB::table('series')
29+
->select(DB::raw('CAST(series_id AS CHAR(20))'));
30+
2931
$invalidNavigationMenuItemIds = DB::table('navigation_menu_items')
3032
->where('type', 'NMI_TYPE_SERIES')
31-
->whereNotIn('path', function (Builder $query) {
32-
$query->select('series_id')->from('series');
33-
})->pluck('navigation_menu_item_id');
33+
->whereNotIn('path', $seriesIds)
34+
->pluck('navigation_menu_item_id');
3435

3536
if (!$invalidNavigationMenuItemIds->count()) {
3637
return;

0 commit comments

Comments
 (0)