-
-
Notifications
You must be signed in to change notification settings - Fork 296
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
I'm attempting to do a ST_Union on a related resource, but that resource is stored in a different schema
calculate :geom, :geometry, expr(fragment("ST_UNION(?)", lgas.geog))
It seems that Ash is not adding the schema (which is defined on the resource) to the query i.e:
* ** (Postgrex.Error) ERROR 42P01 (undefined_table) relation "public.lga" does not exist
query: SELECT DISTINCT ON (s0."id") s0."id", s0."name", s0."inserted_at", s0."updated_at", s0."area", (ST_UNION(l2."geog"))::geometry FROM "service_areas" AS s0 LEFT OUTER JOIN "public"."lga_service_areas" AS l1 ON s0."id" = l1."service_area_id" LEFT OUTER JOIN "public"."lga" AS l2 ON l2."gid" = l1."gid" WHERE (s0."id"::uuid = $1::uuid::uuid)
I'd expect the generated SQL to have the correct schema reference. For reference the resource that the calculation is defined on is in a different domain and different schema than the LGA
resource.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working