Remove old FieldSeeker tables, use v2 generated tables.

This requires a bunch of changes since the types on these tables are
much closer to the underlying types of the Fieldseeker data we are
getting back from the API.

I now need to use proper UUID types everywhere, which means I had to
modify the bob gen config to consistently use google UUID, my UUID
library of choice.

I also had to add the organization_id to all the fieldseeker tables
since we rely on them existing for some of our compound queries.

There were some changes to the API type signatures to get things to
build. I may yet regret those.
This commit is contained in:
Eli Ribble 2025-12-24 17:49:39 -07:00
parent 58f5afccc9
commit 1395e3d3ac
445 changed files with 54077 additions and 275856 deletions

View file

@ -1,17 +1,17 @@
-- Code generated by BobGen psql v0.0.3-0.20251202003046-49148fc66a73+dirty. DO NOT EDIT.
-- Code generated by BobGen psql v0.0.4-0.20251216163753-8e325b7c773a+dirty. DO NOT EDIT.
-- This file is meant to be re-generated in place and/or deleted at any time.
-- TrapLocationBySourceID
SELECT
tl.globalid AS trap_location_globalid,
ST_Distance(pl.geom, tl.geom) AS distance
ST_Distance(pl.geospatial, tl.geospatial) AS distance
FROM
fs_pointlocation pl
fieldseeker.pointlocation pl
CROSS JOIN
fs_traplocation tl
fieldseeker.traplocation tl
WHERE
tl.organization_id = $1 AND
pl.globalid = $2
ORDER BY
ST_Distance(pl.geom, tl.geom)
ST_Distance(pl.geospatial, tl.geospatial)
LIMIT 4;