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,4 +1,4 @@
// 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.
package dbinfo
@ -28,7 +28,7 @@ var FieldseekerZones = Table[
Name: "name",
DBType: "character varying",
Default: "NULL",
Comment: "Name",
Comment: "Original attribute from ArcGIS API is NAME",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -37,7 +37,7 @@ var FieldseekerZones = Table[
Name: "globalid",
DBType: "uuid",
Default: "NULL",
Comment: "",
Comment: "Original attribute from ArcGIS API is GlobalID",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -46,7 +46,7 @@ var FieldseekerZones = Table[
Name: "created_user",
DBType: "character varying",
Default: "NULL",
Comment: "",
Comment: "Original attribute from ArcGIS API is created_user",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -55,7 +55,7 @@ var FieldseekerZones = Table[
Name: "created_date",
DBType: "timestamp without time zone",
Default: "NULL",
Comment: "",
Comment: "Original attribute from ArcGIS API is created_date",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -64,7 +64,7 @@ var FieldseekerZones = Table[
Name: "last_edited_user",
DBType: "character varying",
Default: "NULL",
Comment: "",
Comment: "Original attribute from ArcGIS API is last_edited_user",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -73,7 +73,7 @@ var FieldseekerZones = Table[
Name: "last_edited_date",
DBType: "timestamp without time zone",
Default: "NULL",
Comment: "",
Comment: "Original attribute from ArcGIS API is last_edited_date",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -82,7 +82,7 @@ var FieldseekerZones = Table[
Name: "active",
DBType: "integer",
Default: "NULL",
Comment: "",
Comment: "Original attribute from ArcGIS API is ACTIVE",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -91,7 +91,7 @@ var FieldseekerZones = Table[
Name: "creationdate",
DBType: "timestamp without time zone",
Default: "NULL",
Comment: "",
Comment: "Original attribute from ArcGIS API is CreationDate",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -100,7 +100,7 @@ var FieldseekerZones = Table[
Name: "creator",
DBType: "character varying",
Default: "NULL",
Comment: "",
Comment: "Original attribute from ArcGIS API is Creator",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -109,7 +109,7 @@ var FieldseekerZones = Table[
Name: "editdate",
DBType: "timestamp without time zone",
Default: "NULL",
Comment: "",
Comment: "Original attribute from ArcGIS API is EditDate",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -118,7 +118,7 @@ var FieldseekerZones = Table[
Name: "editor",
DBType: "character varying",
Default: "NULL",
Comment: "",
Comment: "Original attribute from ArcGIS API is Editor",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -127,7 +127,7 @@ var FieldseekerZones = Table[
Name: "shape__area",
DBType: "double precision",
Default: "NULL",
Comment: "",
Comment: "Original attribute from ArcGIS API is Shape__Area",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -136,6 +136,24 @@ var FieldseekerZones = Table[
Name: "shape__length",
DBType: "double precision",
Default: "NULL",
Comment: "Original attribute from ArcGIS API is Shape__Length",
Nullable: true,
Generated: false,
AutoIncr: false,
},
Geometry: column{
Name: "geometry",
DBType: "jsonb",
Default: "",
Comment: "",
Nullable: false,
Generated: false,
AutoIncr: false,
},
Geospatial: column{
Name: "geospatial",
DBType: "geometry",
Default: "NULL",
Comment: "",
Nullable: true,
Generated: false,
@ -145,7 +163,16 @@ var FieldseekerZones = Table[
Name: "version",
DBType: "integer",
Default: "1",
Comment: "Tracks version changes to the row. Increases when data is modified.",
Comment: "",
Nullable: false,
Generated: false,
AutoIncr: false,
},
OrganizationID: column{
Name: "organization_id",
DBType: "integer",
Default: "",
Comment: "",
Nullable: false,
Generated: false,
AutoIncr: false,
@ -180,6 +207,17 @@ var FieldseekerZones = Table[
Columns: []string{"objectid", "version"},
Comment: "",
},
ForeignKeys: fieldseekerZoneForeignKeys{
FieldseekerZonesZonesOrganizationIDFkey: foreignKey{
constraint: constraint{
Name: "fieldseeker.zones.zones_organization_id_fkey",
Columns: []string{"organization_id"},
Comment: "",
},
ForeignTable: "organization",
ForeignColumns: []string{"id"},
},
},
Comment: "",
}
@ -199,12 +237,15 @@ type fieldseekerZoneColumns struct {
Editor column
ShapeArea column
ShapeLength column
Geometry column
Geospatial column
Version column
OrganizationID column
}
func (c fieldseekerZoneColumns) AsSlice() []column {
return []column{
c.Objectid, c.Name, c.Globalid, c.CreatedUser, c.CreatedDate, c.LastEditedUser, c.LastEditedDate, c.Active, c.Creationdate, c.Creator, c.Editdate, c.Editor, c.ShapeArea, c.ShapeLength, c.Version,
c.Objectid, c.Name, c.Globalid, c.CreatedUser, c.CreatedDate, c.LastEditedUser, c.LastEditedDate, c.Active, c.Creationdate, c.Creator, c.Editdate, c.Editor, c.ShapeArea, c.ShapeLength, c.Geometry, c.Geospatial, c.Version, c.OrganizationID,
}
}
@ -218,10 +259,14 @@ func (i fieldseekerZoneIndexes) AsSlice() []index {
}
}
type fieldseekerZoneForeignKeys struct{}
type fieldseekerZoneForeignKeys struct {
FieldseekerZonesZonesOrganizationIDFkey foreignKey
}
func (f fieldseekerZoneForeignKeys) AsSlice() []foreignKey {
return []foreignKey{}
return []foreignKey{
f.FieldseekerZonesZonesOrganizationIDFkey,
}
}
type fieldseekerZoneUniques struct{}