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:
parent
58f5afccc9
commit
1395e3d3ac
445 changed files with 54077 additions and 275856 deletions
11
arcgis.go
11
arcgis.go
|
|
@ -1077,7 +1077,7 @@ func updateSummaryTables(ctx context.Context, org *models.Organization) {
|
|||
log.Error().Err(err).Msg("Failed to get organization")
|
||||
}*/
|
||||
log.Info().Int("org_id", int(org.ID)).Msg("Getting point locations")
|
||||
point_locations, err := org.FSPointlocations().All(ctx, db.PGInstance.BobDB)
|
||||
point_locations, err := org.Pointlocations().All(ctx, db.PGInstance.BobDB)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("Failed to get organization")
|
||||
return
|
||||
|
|
@ -1088,7 +1088,12 @@ func updateSummaryTables(ctx context.Context, org *models.Organization) {
|
|||
log.Info().Int("resolution", i).Msg("Working summary layer")
|
||||
cellToCount := make(map[h3.Cell]int, 0)
|
||||
for _, p := range point_locations {
|
||||
cell, err := getCell(p.GeometryX, p.GeometryY, i)
|
||||
p, err := getPoint(p.Geometry)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("Failed to get geometry point")
|
||||
continue
|
||||
}
|
||||
cell, err := h3.LatLngToCell(p, i)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("Failed to get cell")
|
||||
continue
|
||||
|
|
@ -1615,3 +1620,5 @@ func exportFieldseekerLayer(ctx context.Context, org *models.Organization, fssyn
|
|||
log.Info().Uint("inserts", stats.Inserts).Uint("updates", stats.Updates).Uint("no change", stats.Unchanged).Str("layer", layer.Name).Msg("Finished layer")
|
||||
return stats, nil
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue