PGSQL requires group by id for book search

This commit is contained in:
Robbie Antenesse 2020-07-28 12:19:21 -06:00
parent 97247373a9
commit 0b9e9d00fa
1 changed files with 6 additions and 0 deletions

View File

@ -48,6 +48,12 @@ class SearchController {
[fn('AVG', col('Ratings.rating')), 'averageRating'],
],
order: [[col('totalInteractions'), 'DESC']],
group: [
col('BookReference.id'),
col('Interactions.id'),
col('Reviews.id'),
col('Ratings.id'),
],
};
}