Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

objectionjs column reference is ambiguous

I try to make a query with a join relation with objection.js.

Here is the datastructure:

enter image description here

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?

like image 444
François Romain Avatar asked Mar 28 '26 07:03

François Romain


1 Answers

prefix the conflicting table: whereIn('titres.domaineId'

like image 137
François Romain Avatar answered Mar 30 '26 08:03

François Romain



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!