Make lead creation and invalidation for public reports work

The only thing wrong at this point that I can tell is that address
aren't being correctly populated when I reverse geocode.
This commit is contained in:
Eli Ribble 2026-03-14 01:14:30 +00:00
parent 3e1b56a266
commit e2af49a323
No known key found for this signature in database
27 changed files with 821 additions and 365 deletions

View file

@ -0,0 +1,72 @@
-- +goose Up
DROP VIEW publicreport.report_location;
CREATE VIEW publicreport.report_location AS
SELECT
ROW_NUMBER() OVER (ORDER BY table_name, public_id) AS id,
table_name,
address_id,
address_raw,
created,
location,
location_latitude,
location_longitude,
organization_id,
public_id,
status
FROM (
SELECT
'nuisance' AS table_name,
address_id,
address_raw,
created,
location,
ST_X(location) AS location_longitude,
ST_Y(location) AS location_latitude,
organization_id,
public_id,
status
FROM publicreport.nuisance
UNION
SELECT
'water' AS table_name,
address_id,
address_raw,
created,
location,
ST_X(location) AS location_longitude,
ST_Y(location) AS location_latitude,
organization_id,
public_id,
status
FROM publicreport.water
) AS combined_data;
-- +goose Down
DROP VIEW publicreport.report_location;
CREATE VIEW publicreport.report_location AS
SELECT
ROW_NUMBER() OVER (ORDER BY table_name, public_id) AS id,
table_name,
address_raw,
created,
location,
public_id,
status
FROM (
SELECT
'nuisance' AS table_name,
address_raw,
created,
location,
public_id,
status
FROM publicreport.nuisance
UNION
SELECT
'water' AS table_name,
address_raw,
created,
location,
public_id,
status
FROM publicreport.water
) AS combined_data;