Fixing an issue with inconsistent relationship order.

This commit is contained in:
mike12345567 2024-09-03 12:09:33 +01:00
parent 7e7e23d5d9
commit ac7838f80d
1 changed files with 2 additions and 0 deletions

View File

@ -926,6 +926,8 @@ class InternalBuilder {
)
// relationships should never have more than the base limit
.limit(getBaseLimit())
// add sorting to get consistent order
.orderBy(`${toAlias}.${toPrimary}`)
// need to check the junction table document is to the right column
if (this.client === SqlClient.SQL_LITE) {
subQuery = this.addJoinFieldCheck(subQuery, relationship)