File tree 1 file changed +4
-3
lines changed 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -810,8 +810,8 @@ PostgreSQL.prototype.buildJoin = function(model, filter) {
810
810
}
811
811
const relation =
812
812
modelDefinition . settings . __relations__ [ candidateRelation ] ;
813
- // Only supports belongsTo and hasOne
814
- if ( relation . type !== 'belongsTo' && relation . type !== 'hasOne' ) {
813
+ // Only supports belongsTo, hasOne and hasMany
814
+ if ( relation . type !== 'belongsTo' && relation . type !== 'hasOne' && relation . type !== 'hasMany' ) {
815
815
debug ( 'Invalid relation type for model %s for inner join' , parentModel ) ;
816
816
break ;
817
817
}
@@ -958,7 +958,8 @@ PostgreSQL.prototype.buildJoin = function(model, filter) {
958
958
innerJoin . relation . keyTo ,
959
959
true ,
960
960
innerJoin . prefix ,
961
- ) } ${ innerJoin . relation . type === 'hasOne' ? '::uuid' : '' } `;
961
+ ) } ${ innerJoin . relation . type === 'hasOne'
962
+ || innerJoin . relation . type === 'hasMany' ? '::uuid' : '' } `;
962
963
}
963
964
964
965
return {
You can’t perform that action at this time.
0 commit comments