Remove report_location view, add lat lng to report table

This commit is contained in:
Eli Ribble 2026-03-18 18:55:50 +00:00
parent 341c3ef6b9
commit 21e8b9880d
No known key found for this signature in database
9 changed files with 57 additions and 358 deletions

View file

@ -52,6 +52,8 @@ type PublicreportReport struct {
Reviewed null.Val[time.Time] `db:"reviewed" `
ReviewerID null.Val[int32] `db:"reviewer_id" `
Status enums.PublicreportReportstatustype `db:"status" `
LocationLatitude null.Val[float64] `db:"location_latitude,generated" `
LocationLongitude null.Val[float64] `db:"location_longitude,generated" `
R publicreportReportR `db:"-" `
}
@ -84,7 +86,7 @@ type publicreportReportR struct {
func buildPublicreportReportColumns(alias string) publicreportReportColumns {
return publicreportReportColumns{
ColumnsExpr: expr.NewColumnsExpr(
"address_raw", "address_number", "address_street", "address_locality", "address_region", "address_postal_code", "address_country", "address_id", "created", "location", "h3cell", "id", "latlng_accuracy_type", "latlng_accuracy_value", "map_zoom", "organization_id", "public_id", "reporter_name", "reporter_email", "reporter_phone", "reporter_contact_consent", "report_type", "reviewed", "reviewer_id", "status",
"address_raw", "address_number", "address_street", "address_locality", "address_region", "address_postal_code", "address_country", "address_id", "created", "location", "h3cell", "id", "latlng_accuracy_type", "latlng_accuracy_value", "map_zoom", "organization_id", "public_id", "reporter_name", "reporter_email", "reporter_phone", "reporter_contact_consent", "report_type", "reviewed", "reviewer_id", "status", "location_latitude", "location_longitude",
).WithParent("publicreport.report"),
tableAlias: alias,
AddressRaw: psql.Quote(alias, "address_raw"),
@ -112,6 +114,8 @@ func buildPublicreportReportColumns(alias string) publicreportReportColumns {
Reviewed: psql.Quote(alias, "reviewed"),
ReviewerID: psql.Quote(alias, "reviewer_id"),
Status: psql.Quote(alias, "status"),
LocationLatitude: psql.Quote(alias, "location_latitude"),
LocationLongitude: psql.Quote(alias, "location_longitude"),
}
}
@ -143,6 +147,8 @@ type publicreportReportColumns struct {
Reviewed psql.Expression
ReviewerID psql.Expression
Status psql.Expression
LocationLatitude psql.Expression
LocationLongitude psql.Expression
}
func (c publicreportReportColumns) Alias() string {
@ -1863,6 +1869,8 @@ type publicreportReportWhere[Q psql.Filterable] struct {
Reviewed psql.WhereNullMod[Q, time.Time]
ReviewerID psql.WhereNullMod[Q, int32]
Status psql.WhereMod[Q, enums.PublicreportReportstatustype]
LocationLatitude psql.WhereNullMod[Q, float64]
LocationLongitude psql.WhereNullMod[Q, float64]
}
func (publicreportReportWhere[Q]) AliasedAs(alias string) publicreportReportWhere[Q] {
@ -1896,6 +1904,8 @@ func buildPublicreportReportWhere[Q psql.Filterable](cols publicreportReportColu
Reviewed: psql.WhereNull[Q, time.Time](cols.Reviewed),
ReviewerID: psql.WhereNull[Q, int32](cols.ReviewerID),
Status: psql.Where[Q, enums.PublicreportReportstatustype](cols.Status),
LocationLatitude: psql.WhereNull[Q, float64](cols.LocationLatitude),
LocationLongitude: psql.WhereNull[Q, float64](cols.LocationLongitude),
}
}