The value column in Meta_Select_Item is of String/Character type, while its references like in project (status_select, project_type_select) are of numeric/Integer type.
This resulted in an error, when I was trying to get the list of projects by status using the following query.
SELECT “Meta Select Item”.“title” AS “title”, count(*) AS “count”
FROM “public”.“project_project”
LEFT JOIN “public”.“meta_select_item” “Meta Select Item” ON “public”.“project_project”.“status_select” = “Meta Select Item”.“value”
LEFT JOIN “public”.“meta_select” “Select” ON “Meta Select Item”.“select_id” = “Select”.“id”
WHERE “Select”.“name” = ‘project.status.select’
GROUP BY “Meta Select Item”.“title”
ORDER BY “Meta Select Item”.“title” ASC
So I had to explicitly cast the column to get the query running.
Is this something that is going to be addressed in future release?