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
@ -26,18 +26,18 @@ var FieldseekerTrapdata = Table[
},
Traptype: column{
Name: "traptype",
DBType: "fieldseeker.trapdata_mosquitotraptype_enum",
DBType: "character varying",
Default: "NULL",
Comment: "Trap Type",
Comment: "Original attribute from ArcGIS API is TRAPTYPE",
Nullable: true,
Generated: false,
AutoIncr: false,
},
Trapactivitytype: column{
Name: "trapactivitytype",
DBType: "fieldseeker.trapdata_notinuitrapactivitytype_enum",
DBType: "character varying",
Default: "NULL",
Comment: "Trap Activity Type",
Comment: "Original attribute from ArcGIS API is TRAPACTIVITYTYPE",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -46,7 +46,7 @@ var FieldseekerTrapdata = Table[
Name: "startdatetime",
DBType: "timestamp without time zone",
Default: "NULL",
Comment: "Start",
Comment: "Original attribute from ArcGIS API is STARTDATETIME",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -55,7 +55,7 @@ var FieldseekerTrapdata = Table[
Name: "enddatetime",
DBType: "timestamp without time zone",
Default: "NULL",
Comment: "Finish",
Comment: "Original attribute from ArcGIS API is ENDDATETIME",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -64,7 +64,7 @@ var FieldseekerTrapdata = Table[
Name: "comments",
DBType: "character varying",
Default: "NULL",
Comment: "Comments",
Comment: "Original attribute from ArcGIS API is COMMENTS",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -73,7 +73,7 @@ var FieldseekerTrapdata = Table[
Name: "idbytech",
DBType: "character varying",
Default: "NULL",
Comment: "Tech Identifying Species in Lab",
Comment: "Original attribute from ArcGIS API is IDBYTECH",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -82,25 +82,25 @@ var FieldseekerTrapdata = Table[
Name: "sortbytech",
DBType: "character varying",
Default: "NULL",
Comment: "Tech Sorting Trap Results in Lab",
Comment: "Original attribute from ArcGIS API is SORTBYTECH",
Nullable: true,
Generated: false,
AutoIncr: false,
},
Processed: column{
Name: "processed",
DBType: "fieldseeker.trapdata_notinuit_f_enum",
DBType: "smallint",
Default: "NULL",
Comment: "Processed",
Comment: "Original attribute from ArcGIS API is PROCESSED",
Nullable: true,
Generated: false,
AutoIncr: false,
},
Sitecond: column{
Name: "sitecond",
DBType: "fieldseeker.trapdata_mosquitositecondition_enum",
DBType: "character varying",
Default: "NULL",
Comment: "Site Conditions",
Comment: "Original attribute from ArcGIS API is SITECOND",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -109,7 +109,7 @@ var FieldseekerTrapdata = Table[
Name: "locationname",
DBType: "character varying",
Default: "NULL",
Comment: "Location Name",
Comment: "Original attribute from ArcGIS API is LOCATIONNAME",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -118,16 +118,16 @@ var FieldseekerTrapdata = Table[
Name: "recordstatus",
DBType: "smallint",
Default: "NULL",
Comment: "RecordStatus",
Comment: "Original attribute from ArcGIS API is RECORDSTATUS",
Nullable: true,
Generated: false,
AutoIncr: false,
},
Reviewed: column{
Name: "reviewed",
DBType: "fieldseeker.trapdata_notinuit_f_enum",
DBType: "smallint",
Default: "NULL",
Comment: "Reviewed",
Comment: "Original attribute from ArcGIS API is REVIEWED",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -136,7 +136,7 @@ var FieldseekerTrapdata = Table[
Name: "reviewedby",
DBType: "character varying",
Default: "NULL",
Comment: "Reviewed By",
Comment: "Original attribute from ArcGIS API is REVIEWEDBY",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -145,16 +145,16 @@ var FieldseekerTrapdata = Table[
Name: "revieweddate",
DBType: "timestamp without time zone",
Default: "NULL",
Comment: "Reviewed Date",
Comment: "Original attribute from ArcGIS API is REVIEWEDDATE",
Nullable: true,
Generated: false,
AutoIncr: false,
},
Trapcondition: column{
Name: "trapcondition",
DBType: "fieldseeker.trapdata_mosquitotrapcondition_enum",
DBType: "character varying",
Default: "NULL",
Comment: "Trap Condition",
Comment: "Original attribute from ArcGIS API is TRAPCONDITION",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -163,7 +163,7 @@ var FieldseekerTrapdata = Table[
Name: "trapnights",
DBType: "smallint",
Default: "NULL",
Comment: "Trap Nights",
Comment: "Original attribute from ArcGIS API is TRAPNIGHTS",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -172,7 +172,7 @@ var FieldseekerTrapdata = Table[
Name: "zone",
DBType: "character varying",
Default: "NULL",
Comment: "Zone",
Comment: "Original attribute from ArcGIS API is ZONE",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -181,7 +181,7 @@ var FieldseekerTrapdata = Table[
Name: "zone2",
DBType: "character varying",
Default: "NULL",
Comment: "Zone2",
Comment: "Original attribute from ArcGIS API is ZONE2",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -190,7 +190,7 @@ var FieldseekerTrapdata = Table[
Name: "globalid",
DBType: "uuid",
Default: "NULL",
Comment: "",
Comment: "Original attribute from ArcGIS API is GlobalID",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -199,7 +199,7 @@ var FieldseekerTrapdata = 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,
@ -208,7 +208,7 @@ var FieldseekerTrapdata = 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,
@ -217,7 +217,7 @@ var FieldseekerTrapdata = 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,
@ -226,7 +226,7 @@ var FieldseekerTrapdata = 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,
@ -235,7 +235,7 @@ var FieldseekerTrapdata = Table[
Name: "srid",
DBType: "uuid",
Default: "NULL",
Comment: "",
Comment: "Original attribute from ArcGIS API is SRID",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -244,7 +244,7 @@ var FieldseekerTrapdata = Table[
Name: "fieldtech",
DBType: "character varying",
Default: "NULL",
Comment: "Field Tech",
Comment: "Original attribute from ArcGIS API is FIELDTECH",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -253,7 +253,7 @@ var FieldseekerTrapdata = Table[
Name: "gatewaysync",
DBType: "smallint",
Default: "NULL",
Comment: "Gateway Sync",
Comment: "Original attribute from ArcGIS API is GATEWAYSYNC",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -262,7 +262,7 @@ var FieldseekerTrapdata = Table[
Name: "loc_id",
DBType: "uuid",
Default: "NULL",
Comment: "",
Comment: "Original attribute from ArcGIS API is LOC_ID",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -271,16 +271,16 @@ var FieldseekerTrapdata = Table[
Name: "voltage",
DBType: "double precision",
Default: "NULL",
Comment: "Voltage",
Comment: "Original attribute from ArcGIS API is VOLTAGE",
Nullable: true,
Generated: false,
AutoIncr: false,
},
Winddir: column{
Name: "winddir",
DBType: "fieldseeker.trapdata_trapdata_winddir_c1a31e05_d0b9_4b22_8800_be127bb3f166_",
DBType: "character varying",
Default: "NULL",
Comment: "",
Comment: "Original attribute from ArcGIS API is WINDDIR",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -289,7 +289,7 @@ var FieldseekerTrapdata = Table[
Name: "windspeed",
DBType: "double precision",
Default: "NULL",
Comment: "",
Comment: "Original attribute from ArcGIS API is WINDSPEED",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -298,7 +298,7 @@ var FieldseekerTrapdata = Table[
Name: "avetemp",
DBType: "double precision",
Default: "NULL",
Comment: "",
Comment: "Original attribute from ArcGIS API is AVETEMP",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -307,7 +307,7 @@ var FieldseekerTrapdata = Table[
Name: "raingauge",
DBType: "double precision",
Default: "NULL",
Comment: "",
Comment: "Original attribute from ArcGIS API is RAINGAUGE",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -316,7 +316,7 @@ var FieldseekerTrapdata = Table[
Name: "lr",
DBType: "smallint",
Default: "NULL",
Comment: "Landing Rate",
Comment: "Original attribute from ArcGIS API is LR",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -325,7 +325,7 @@ var FieldseekerTrapdata = Table[
Name: "field",
DBType: "integer",
Default: "NULL",
Comment: "",
Comment: "Original attribute from ArcGIS API is Field",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -334,7 +334,7 @@ var FieldseekerTrapdata = Table[
Name: "vectorsurvtrapdataid",
DBType: "character varying",
Default: "NULL",
Comment: "",
Comment: "Original attribute from ArcGIS API is VECTORSURVTRAPDATAID",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -343,7 +343,7 @@ var FieldseekerTrapdata = Table[
Name: "vectorsurvtraplocationid",
DBType: "character varying",
Default: "NULL",
Comment: "",
Comment: "Original attribute from ArcGIS API is VECTORSURVTRAPLOCATIONID",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -352,7 +352,7 @@ var FieldseekerTrapdata = 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,
@ -361,7 +361,7 @@ var FieldseekerTrapdata = Table[
Name: "creator",
DBType: "character varying",
Default: "NULL",
Comment: "",
Comment: "Original attribute from ArcGIS API is Creator",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -370,7 +370,7 @@ var FieldseekerTrapdata = 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,
@ -379,14 +379,32 @@ var FieldseekerTrapdata = Table[
Name: "editor",
DBType: "character varying",
Default: "NULL",
Comment: "",
Comment: "Original attribute from ArcGIS API is Editor",
Nullable: true,
Generated: false,
AutoIncr: false,
},
Lure: column{
Name: "lure",
DBType: "fieldseeker.trapdata_trapdata_lure_25fe542f_077f_4254_8681_76e8f436354b_enu",
DBType: "character varying",
Default: "NULL",
Comment: "Original attribute from ArcGIS API is Lure",
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,
@ -397,7 +415,16 @@ var FieldseekerTrapdata = 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,
@ -432,6 +459,17 @@ var FieldseekerTrapdata = Table[
Columns: []string{"objectid", "version"},
Comment: "",
},
ForeignKeys: fieldseekerTrapdatumForeignKeys{
FieldseekerTrapdataTrapdataOrganizationIDFkey: foreignKey{
constraint: constraint{
Name: "fieldseeker.trapdata.trapdata_organization_id_fkey",
Columns: []string{"organization_id"},
Comment: "",
},
ForeignTable: "organization",
ForeignColumns: []string{"id"},
},
},
Comment: "",
}
@ -479,12 +517,15 @@ type fieldseekerTrapdatumColumns struct {
Editdate column
Editor column
Lure column
Geometry column
Geospatial column
Version column
OrganizationID column
}
func (c fieldseekerTrapdatumColumns) AsSlice() []column {
return []column{
c.Objectid, c.Traptype, c.Trapactivitytype, c.Startdatetime, c.Enddatetime, c.Comments, c.Idbytech, c.Sortbytech, c.Processed, c.Sitecond, c.Locationname, c.Recordstatus, c.Reviewed, c.Reviewedby, c.Revieweddate, c.Trapcondition, c.Trapnights, c.Zone, c.Zone2, c.Globalid, c.CreatedUser, c.CreatedDate, c.LastEditedUser, c.LastEditedDate, c.Srid, c.Fieldtech, c.Gatewaysync, c.LocID, c.Voltage, c.Winddir, c.Windspeed, c.Avetemp, c.Raingauge, c.LR, c.Field, c.Vectorsurvtrapdataid, c.Vectorsurvtraplocationid, c.Creationdate, c.Creator, c.Editdate, c.Editor, c.Lure, c.Version,
c.Objectid, c.Traptype, c.Trapactivitytype, c.Startdatetime, c.Enddatetime, c.Comments, c.Idbytech, c.Sortbytech, c.Processed, c.Sitecond, c.Locationname, c.Recordstatus, c.Reviewed, c.Reviewedby, c.Revieweddate, c.Trapcondition, c.Trapnights, c.Zone, c.Zone2, c.Globalid, c.CreatedUser, c.CreatedDate, c.LastEditedUser, c.LastEditedDate, c.Srid, c.Fieldtech, c.Gatewaysync, c.LocID, c.Voltage, c.Winddir, c.Windspeed, c.Avetemp, c.Raingauge, c.LR, c.Field, c.Vectorsurvtrapdataid, c.Vectorsurvtraplocationid, c.Creationdate, c.Creator, c.Editdate, c.Editor, c.Lure, c.Geometry, c.Geospatial, c.Version, c.OrganizationID,
}
}
@ -498,10 +539,14 @@ func (i fieldseekerTrapdatumIndexes) AsSlice() []index {
}
}
type fieldseekerTrapdatumForeignKeys struct{}
type fieldseekerTrapdatumForeignKeys struct {
FieldseekerTrapdataTrapdataOrganizationIDFkey foreignKey
}
func (f fieldseekerTrapdatumForeignKeys) AsSlice() []foreignKey {
return []foreignKey{}
return []foreignKey{
f.FieldseekerTrapdataTrapdataOrganizationIDFkey,
}
}
type fieldseekerTrapdatumUniques struct{}