From 07cb6b4846cbe390c7bc017c417a55a8e122aebc Mon Sep 17 00:00:00 2001 From: Mike Simpson Date: Thu, 6 Apr 2023 15:21:59 +0100 Subject: [PATCH] Add Survival Source --- app/src/api/config/dataFields.ts | 4 ++++ app/src/tiles/dataDefinition.ts | 8 ++++++++ maintenance/extract_data/export_attributes.sql | 3 ++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/app/src/api/config/dataFields.ts b/app/src/api/config/dataFields.ts index 681bb467..f3158851 100644 --- a/app/src/api/config/dataFields.ts +++ b/app/src/api/config/dataFields.ts @@ -300,6 +300,10 @@ export const buildingAttributesConfig = valueType()({ /* eslint edit: true, verify: true }, + survival_source: { + edit: true, + verify: true + }, likes_total: { edit: false, derivedEdit: true, diff --git a/app/src/tiles/dataDefinition.ts b/app/src/tiles/dataDefinition.ts index d8ef75d7..4b5bd732 100644 --- a/app/src/tiles/dataDefinition.ts +++ b/app/src/tiles/dataDefinition.ts @@ -133,6 +133,14 @@ const LAYER_QUERIES = { buildings WHERE survival_status IS NOT NULL`, + survival_source: ` + SELECT + geometry_id, + survival_source + FROM + buildings + WHERE + survival_source IS NOT NULL`, likes: ` SELECT geometry_id, diff --git a/maintenance/extract_data/export_attributes.sql b/maintenance/extract_data/export_attributes.sql index 49082140..561ac7f2 100644 --- a/maintenance/extract_data/export_attributes.sql +++ b/maintenance/extract_data/export_attributes.sql @@ -57,7 +57,8 @@ COPY (SELECT is_domestic, community_type_worth_keeping_total, likes_total, - survival_status + survival_status, + survival_source FROM buildings) TO '/tmp/building_attributes.csv' WITH CSV HEADER