Fix one-to-many
This commit is contained in:
parent
a476da08fa
commit
3ea8e240e4
|
@ -518,10 +518,12 @@ class InternalBuilder {
|
|||
mainKnex.raw(this.quotedIdentifier(foreignKey))
|
||||
)
|
||||
|
||||
query = query.whereExists(whereCb(updatedKey, subQuery))
|
||||
if (allowEmptyRelationships) {
|
||||
query = query.orWhereNull(foreignKey)
|
||||
}
|
||||
query = query.where(q => {
|
||||
q.whereExists(whereCb(updatedKey, subQuery))
|
||||
if (allowEmptyRelationships) {
|
||||
q.orWhereNull(foreignKey)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue