This involves rebuilding the "publicreport.report_location" view after making a bunch of changes to making publicreport.water the consistent name (over pool) throughout RMA tables.
60 lines
1,019 B
SQL
60 lines
1,019 B
SQL
-- +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_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;
|
|
-- +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
|
|
'pool' AS table_name,
|
|
address_raw,
|
|
created,
|
|
location,
|
|
public_id,
|
|
status
|
|
FROM publicreport.water
|
|
) AS combined_data;
|