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 FieldseekerPools = Table[
Name: "trapdata_id",
DBType: "uuid",
Default: "NULL",
Comment: "Trap Data ID",
Comment: "Original attribute from ArcGIS API is TRAPDATA_ID",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -37,7 +37,7 @@ var FieldseekerPools = Table[
Name: "datesent",
DBType: "timestamp without time zone",
Default: "NULL",
Comment: "Date Sent",
Comment: "Original attribute from ArcGIS API is DATESENT",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -46,7 +46,7 @@ var FieldseekerPools = Table[
Name: "survtech",
DBType: "character varying",
Default: "NULL",
Comment: "Survey Tech",
Comment: "Original attribute from ArcGIS API is SURVTECH",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -55,7 +55,7 @@ var FieldseekerPools = Table[
Name: "datetested",
DBType: "timestamp without time zone",
Default: "NULL",
Comment: "Date Tested",
Comment: "Original attribute from ArcGIS API is DATETESTED",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -64,7 +64,7 @@ var FieldseekerPools = Table[
Name: "testtech",
DBType: "character varying",
Default: "NULL",
Comment: "Test Tech",
Comment: "Original attribute from ArcGIS API is TESTTECH",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -73,7 +73,7 @@ var FieldseekerPools = Table[
Name: "comments",
DBType: "character varying",
Default: "NULL",
Comment: "Comments",
Comment: "Original attribute from ArcGIS API is COMMENTS",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -82,16 +82,16 @@ var FieldseekerPools = Table[
Name: "sampleid",
DBType: "character varying",
Default: "NULL",
Comment: "Sample ID",
Comment: "Original attribute from ArcGIS API is SAMPLEID",
Nullable: true,
Generated: false,
AutoIncr: false,
},
Processed: column{
Name: "processed",
DBType: "fieldseeker.pool_notinuit_f_enum",
DBType: "smallint",
Default: "NULL",
Comment: "Processed",
Comment: "Original attribute from ArcGIS API is PROCESSED",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -100,34 +100,34 @@ var FieldseekerPools = Table[
Name: "lab_id",
DBType: "uuid",
Default: "NULL",
Comment: "",
Comment: "Original attribute from ArcGIS API is LAB_ID",
Nullable: true,
Generated: false,
AutoIncr: false,
},
Testmethod: column{
Name: "testmethod",
DBType: "fieldseeker.pool_pool_testmethod_670efbfba86d41ba8e2d3cab5d749e7f_enum",
DBType: "character varying",
Default: "NULL",
Comment: "Test Methods",
Comment: "Original attribute from ArcGIS API is TESTMETHOD",
Nullable: true,
Generated: false,
AutoIncr: false,
},
Diseasetested: column{
Name: "diseasetested",
DBType: "fieldseeker.pool_pool_diseasetested_0f02232949c04c7e8de820b9b515ed97_enum",
DBType: "character varying",
Default: "NULL",
Comment: "Diseases Tested",
Comment: "Original attribute from ArcGIS API is DISEASETESTED",
Nullable: true,
Generated: false,
AutoIncr: false,
},
Diseasepos: column{
Name: "diseasepos",
DBType: "fieldseeker.pool_pool_diseasepos_6889f8dd00074874aa726907e78497fa_enum",
DBType: "character varying",
Default: "NULL",
Comment: "Diseases Positive",
Comment: "Original attribute from ArcGIS API is DISEASEPOS",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -136,7 +136,7 @@ var FieldseekerPools = Table[
Name: "globalid",
DBType: "uuid",
Default: "NULL",
Comment: "",
Comment: "Original attribute from ArcGIS API is GlobalID",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -145,7 +145,7 @@ var FieldseekerPools = 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,
@ -154,7 +154,7 @@ var FieldseekerPools = 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,
@ -163,7 +163,7 @@ var FieldseekerPools = 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,
@ -172,16 +172,16 @@ var FieldseekerPools = 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,
},
Lab: column{
Name: "lab",
DBType: "fieldseeker.pool_mosquitolabname_enum",
DBType: "character varying",
Default: "NULL",
Comment: "",
Comment: "Original attribute from ArcGIS API is LAB",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -190,7 +190,7 @@ var FieldseekerPools = Table[
Name: "poolyear",
DBType: "smallint",
Default: "NULL",
Comment: "Pool Year",
Comment: "Original attribute from ArcGIS API is POOLYEAR",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -199,7 +199,7 @@ var FieldseekerPools = Table[
Name: "gatewaysync",
DBType: "smallint",
Default: "NULL",
Comment: "Gateway Sync",
Comment: "Original attribute from ArcGIS API is GATEWAYSYNC",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -208,7 +208,7 @@ var FieldseekerPools = Table[
Name: "vectorsurvcollectionid",
DBType: "character varying",
Default: "NULL",
Comment: "",
Comment: "Original attribute from ArcGIS API is VECTORSURVCOLLECTIONID",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -217,7 +217,7 @@ var FieldseekerPools = Table[
Name: "vectorsurvpoolid",
DBType: "character varying",
Default: "NULL",
Comment: "",
Comment: "Original attribute from ArcGIS API is VECTORSURVPOOLID",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -226,7 +226,7 @@ var FieldseekerPools = Table[
Name: "vectorsurvtrapdataid",
DBType: "character varying",
Default: "NULL",
Comment: "",
Comment: "Original attribute from ArcGIS API is VECTORSURVTRAPDATAID",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -235,7 +235,7 @@ var FieldseekerPools = 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,
@ -244,7 +244,7 @@ var FieldseekerPools = Table[
Name: "creator",
DBType: "character varying",
Default: "NULL",
Comment: "",
Comment: "Original attribute from ArcGIS API is Creator",
Nullable: true,
Generated: false,
AutoIncr: false,
@ -253,7 +253,7 @@ var FieldseekerPools = 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,
@ -262,6 +262,24 @@ var FieldseekerPools = Table[
Name: "editor",
DBType: "character varying",
Default: "NULL",
Comment: "Original attribute from ArcGIS API is Editor",
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,
@ -271,7 +289,16 @@ var FieldseekerPools = 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,
@ -306,6 +333,17 @@ var FieldseekerPools = Table[
Columns: []string{"objectid", "version"},
Comment: "",
},
ForeignKeys: fieldseekerPoolForeignKeys{
FieldseekerPoolPoolOrganizationIDFkey: foreignKey{
constraint: constraint{
Name: "fieldseeker.pool.pool_organization_id_fkey",
Columns: []string{"organization_id"},
Comment: "",
},
ForeignTable: "organization",
ForeignColumns: []string{"id"},
},
},
Comment: "",
}
@ -339,12 +377,15 @@ type fieldseekerPoolColumns struct {
Creator column
Editdate column
Editor column
Geometry column
Geospatial column
Version column
OrganizationID column
}
func (c fieldseekerPoolColumns) AsSlice() []column {
return []column{
c.Objectid, c.TrapdataID, c.Datesent, c.Survtech, c.Datetested, c.Testtech, c.Comments, c.Sampleid, c.Processed, c.LabID, c.Testmethod, c.Diseasetested, c.Diseasepos, c.Globalid, c.CreatedUser, c.CreatedDate, c.LastEditedUser, c.LastEditedDate, c.Lab, c.Poolyear, c.Gatewaysync, c.Vectorsurvcollectionid, c.Vectorsurvpoolid, c.Vectorsurvtrapdataid, c.Creationdate, c.Creator, c.Editdate, c.Editor, c.Version,
c.Objectid, c.TrapdataID, c.Datesent, c.Survtech, c.Datetested, c.Testtech, c.Comments, c.Sampleid, c.Processed, c.LabID, c.Testmethod, c.Diseasetested, c.Diseasepos, c.Globalid, c.CreatedUser, c.CreatedDate, c.LastEditedUser, c.LastEditedDate, c.Lab, c.Poolyear, c.Gatewaysync, c.Vectorsurvcollectionid, c.Vectorsurvpoolid, c.Vectorsurvtrapdataid, c.Creationdate, c.Creator, c.Editdate, c.Editor, c.Geometry, c.Geospatial, c.Version, c.OrganizationID,
}
}
@ -358,10 +399,14 @@ func (i fieldseekerPoolIndexes) AsSlice() []index {
}
}
type fieldseekerPoolForeignKeys struct{}
type fieldseekerPoolForeignKeys struct {
FieldseekerPoolPoolOrganizationIDFkey foreignKey
}
func (f fieldseekerPoolForeignKeys) AsSlice() []foreignKey {
return []foreignKey{}
return []foreignKey{
f.FieldseekerPoolPoolOrganizationIDFkey,
}
}
type fieldseekerPoolUniques struct{}