Always cast M2A related primary keys to text. (#9122)

This commit is contained in:
Oreille
2021-10-25 15:53:44 +02:00
committed by GitHub
parent 712e1c24fa
commit d06abbd797

View File

@@ -195,7 +195,7 @@ export function applyFilter(
.on(
`${parentAlias || parentCollection}.${relation.field}`,
'=',
`${alias}.${schema.collections[pathScope].primary}`
knex.raw(`CAST(?? AS TEXT)`, `${alias}.${schema.collections[pathScope].primary}`)
)
.andOnVal(relation.meta!.one_collection_field!, '=', pathScope);
});