Fix issue with upgrade.

This commit is contained in:
James Cole 2019-02-13 17:54:46 +01:00
parent bf3c74e65f
commit 22bc6d507e

View File

@ -273,7 +273,8 @@ class UpgradeDatabase extends Command
->whereNull('transactions.deleted_at')
->groupBy(['transaction_journals.id'])
->select(['transaction_journals.id', DB::raw('COUNT(transactions.id) AS t_count')]);
$result = DB::table((string)DB::raw('(' . $subQuery->toSql() . ') AS derived'))
/** @noinspection PhpStrictTypeCheckingInspection */
$result = DB::table(DB::raw('(' . $subQuery->toSql() . ') AS derived'))
->mergeBindings($subQuery->getQuery())
->where('t_count', '>', 2)
->select(['id', 't_count']);