[API] m2a filtering fix (#9666)

* [API] m2a filtering fix

MySQL does not support CAST to VARCHAR type.

* Use CHAR(255) instead of CHAR

Co-authored-by: Oreille <33065839+Oreilles@users.noreply.github.com>
This commit is contained in:
d1rOn
2021-11-11 22:39:05 +02:00
committed by GitHub
parent 23752f622a
commit f10d01d7f1

View File

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