Move data out of import.district and in to organization

Then get the organization settings page to work again.

Tons of other stuff is broken now.
This commit is contained in:
Eli Ribble 2026-02-17 05:33:12 +00:00
parent b786c88f52
commit 5a7c9fd090
No known key found for this signature in database
31 changed files with 2001 additions and 4340 deletions

View file

@ -13,7 +13,7 @@ GRANT USAGE ON SCHEMA import TO "tegola";
GRANT USAGE ON SCHEMA publicreport TO "tegola";
GRANT SELECT ON fileupload.pool TO "tegola";
GRANT SELECT ON h3_aggregation to "tegola";
GRANT SELECT ON import.district TO "tegola";
GRANT SELECT ON organization TO "tegola";
GRANT SELECT ON publicreport.report_location TO "tegola";
GRANT ALL PRIVILEGES ON SCHEMA public TO $1;
-- do import of district data
@ -21,3 +21,20 @@ ALTER TABLE import.district ADD COLUMN geom_4326 geometry(MultiPolygon,4326) GEN
ALTER TABLE import.district ADD COLUMN centroid_4326 geometry(Point,4326) GENERATED ALWAYS AS (ST_Transform(ST_Centroid(geom), 4326)) STORED;
ALTER TABLE import.district ADD COLUMN extent_4326 geometry(Polygon,4326) GENERATED ALWAYS AS (ST_Transform(ST_Envelope(geom), 4326)) STORED;
ALTER TABLE import.district ADD COLUMN area_4326_sqm numeric GENERATED ALWAYS AS (ST_Area(ST_Transform(geom, 4326)::geography)) STORED;
UPDATE organization AS org
SET
website = dist.website,
general_manager_name = dist.general_mg,
mailing_address_city = dist.city2,
mailing_address_postal_code = dist.postal_c_1::text,
mailing_address_street = dist.address2,
office_address_city = dist.city1,
office_address_postal_code = dist.postal_cod::text,
office_address_street = dist.address,
office_phone = dist.phone1,
office_fax = dist.fax1,
service_area_geometry = dist.geom_4326
FROM import.district AS dist
WHERE org.import_district_gid = dist.gid;