Relationship select executes distinct query that doesn't support having JSON columns

Pretty easy, we have a products table that has a json field. And it has a relation to itselfs. We use this select:
Forms\Components\Select::make('upsells_data')
->relationship('upsells', 'name')
->maxItems(5)
->multiple()
->preload()
->searchable(),
Forms\Components\Select::make('upsells_data')
->relationship('upsells', 'name')
->maxItems(5)
->multiple()
->preload()
->searchable(),
but we get this error:
SQLSTATE[42883]: Undefined function: 7 ERROR: could not identify an equality operator for type json LINE 1: select distinct "products".* from "products" left join "prod... ^
select
distinct "products".*
from
"products"
left join "product_upsells" on "products"."id" = "product_upsells"."upsell_id"
where
"products"."deleted_at" is null
order by
"products"."name" asc
SQLSTATE[42883]: Undefined function: 7 ERROR: could not identify an equality operator for type json LINE 1: select distinct "products".* from "products" left join "prod... ^
select
distinct "products".*
from
"products"
left join "product_upsells" on "products"."id" = "product_upsells"."upsell_id"
where
"products"."deleted_at" is null
order by
"products"."name" asc
wondering how i could fix this issue
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?