colouring-montreal/migrations/045.typology_changes.up.sql
Mike Simpson 602449cf58 Add Original Land Use (Order) to Key
Copied code from Current Land Use (Land Use Category) to automatically calculate the Land Use Order for Original Land Use and then visualise it on the map. #1219
2023-08-03 16:42:12 +01:00

9 lines
367 B
SQL

ALTER TABLE buildings ADD COLUMN IF NOT EXISTS typology_original_use_order text;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS typology_original_use_verified BOOLEAN NOT NULL DEFAULT FALSE;
UPDATE buildings as b
SET typology_original_use_verified = TRUE
FROM building_verification as v
WHERE b.building_id = v.building_id
AND v.attribute = 'current_landuse_group';