I try to make a query with a join relation with objection.js.
Here is the datastructure:
Here is the query:
Titres.query()
.skipUndefined()
.whereIn('typeId', typeIds)
.whereIn('domaineId', domaineIds)
.whereIn('statutId', statutIds)
.joinRelation('demarches.etapes.substances')
.where('demarches:etapes:substances.id', substances)
.eager('[domaine, demarches.[type, etapes.substances.domaine]]')
This makes an error: column reference \"domaine_id\" is ambiguous
How is it possible to make it work?
prefix the conflicting table: whereIn('titres.domaineId'