Move imported districts to its own schema, add ref from organization

This will make it possible to assign reports to an organization
This commit is contained in:
Eli Ribble 2026-01-16 14:43:26 +00:00
parent 9b5140f0c2
commit 684c424131
No known key found for this signature in database
16 changed files with 1561 additions and 702 deletions

View file

@ -11,8 +11,8 @@ import (
"github.com/stephenafamo/bob/dialect/psql/sm"
)
func DistrictForLocation(ctx context.Context, lng float64, lat float64) (*models.District, error) {
rows, err := models.Districts.Query(
func DistrictForLocation(ctx context.Context, lng float64, lat float64) (*models.ImportDistrict, error) {
rows, err := models.ImportDistricts.Query(
sm.Where(
psql.F("ST_Contains", psql.Raw("geom_4326"), psql.F("ST_SetSRID", psql.F("ST_MakePoint", psql.Arg(lng), psql.Arg(lat)), psql.Arg(4326))),
),