1
0
Fork 0
mirror of synced 2024-08-23 05:51:29 +12:00

Quick fix for ambiguous column names _id.

This commit is contained in:
mike12345567 2024-05-29 11:56:52 +01:00
parent 394fa2536c
commit 6b7a4f07cb

View file

@ -399,8 +399,12 @@ class InternalBuilder {
// when searching internal tables make sure long looking for rows
if (filters.documentType && !isExternalTable(table)) {
const tableRef = opts?.aliases?.[table._id!] || table._id
// has to be its own option, must always be AND onto the search
query.andWhereLike("_id", `${prefixed(filters.documentType)}%`)
query.andWhereLike(
`${tableRef}._id`,
`${prefixed(filters.documentType)}%`
)
}
return query