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:
parent
9b5140f0c2
commit
684c424131
16 changed files with 1561 additions and 702 deletions
|
|
@ -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))),
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue