Additional categories for conservation areas

- closes #214
- closes #210
- closes #193
- closes #171
This commit is contained in:
dominic 2019-03-22 18:01:57 +00:00
parent 05448cc6d4
commit 83e7d865f4

View File

@ -1,16 +1,50 @@
-- Create planning and controls fields -- Create planning and controls fields
-- Planning Portal -- Planning Portal
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_portal_link varchar DEFAULT ''; ALTER TABLE buildings
ADD COLUMN IF NOT EXISTS planning_portal_link VARCHAR DEFAULT '';
-- Conservation area (bool, name) -- Conservation area (bool, name)
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_in_conservation_area boolean DEFAULT false; ALTER TABLE buildings
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_conservation_area_name varchar DEFAULT ''; ADD COLUMN IF NOT EXISTS planning_in_conservation_area boolean DEFAULT FALSE;
ALTER TABLE buildings
ADD COLUMN IF NOT EXISTS planning_conservation_area_name VARCHAR DEFAULT '';
--Additional data fields for listed builidngs
ALTER TABLE buildings
ADD COLUMN IF NOT EXISTS planning_list_date DATE DEFAULT NULL;
ALTER TABLE buildings
ADD COLUMN IF NOT EXISTS planning_list_amend_date DATE DEFAULT NULL;
--additional data fields for consevation areas
ALTER TABLE buildings
ADD COLUMN IF NOT EXISTS planning_conservation_area_delegation_date DATE DEFAULT NULL;
ALTER TABLE buildings
ADD COLUMN IF NOT EXISTS planning_conservation_area_update_date DATE DEFAULT NULL;
ALTER TABLE buildings DROP COLUMN IF EXISTS planning_conservation_area_update_type;
CREATE TYPE planning_conservation_area_update_type
AS ENUM ('Extended',
'Reviewed',
'Amalgamated',
'Revised',
'Unknown',
'Amended',
'Reduced');
ALTER TABLE buildings
ADD COLUMN IF NOT EXISTS planning_conservation_area_update_type DEFAULT 'unknown';
-- Listed (bool, list id) -- Listed (bool, list id)
-- e.g. https://historicengland.org.uk/listing/the-list/list-entry/1294614 -- e.g. https://historicengland.org.uk/listing/the-list/list-entry/1294614
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_in_list boolean DEFAULT false; ALTER TABLE buildings
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_list_id int DEFAULT null; ADD COLUMN IF NOT EXISTS planning_in_list boolean DEFAULT FALSE;
ALTER TABLE buildings
ADD COLUMN IF NOT EXISTS planning_list_id int DEFAULT NULL;
-- List category, one of: -- List category, one of:
-- - Listed Building -- - Listed Building
@ -21,8 +55,8 @@ ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_list_id int DEFAULT null
-- - World Heritage Site -- - World Heritage Site
-- - Certificate of Immunity -- - Certificate of Immunity
-- - Building Preservation Notice -- - Building Preservation Notice
CREATE TYPE planning_list_cat AS ENUM ( CREATE TYPE planning_list_cat
'Listed Building', AS ENUM ('Listed Building',
'Scheduled Monument', 'Scheduled Monument',
'Wreck', 'Wreck',
'Park and Garden', 'Park and Garden',
@ -30,48 +64,71 @@ CREATE TYPE planning_list_cat AS ENUM (
'World Heritage Site', 'World Heritage Site',
'Certificate of Immunity', 'Certificate of Immunity',
'Building Preservation Notice', 'Building Preservation Notice',
'None' 'None');
);
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_list_cat planning_list_cat DEFAULT 'None'; ALTER TABLE buildings
ADD COLUMN IF NOT EXISTS planning_list_cat planning_list_cat DEFAULT 'None';
-- Listing grade, for Listed Building only, one of: -- Listing grade, for Listed Building only, one of:
-- - I -- - I
-- - II* -- - II*
-- - II -- - II
CREATE TYPE planning_list_grade AS ENUM ('I', 'II*', 'II', 'None'); CREATE TYPE planning_list_grade
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_list_grade planning_list_grade DEFAULT 'None'; AS ENUM ('I',
'II*',
'II',
'None');
ALTER TABLE buildings
ADD COLUMN IF NOT EXISTS planning_list_grade planning_list_grade DEFAULT 'None';
-- Heritage at risk (bool, at-risk id) -- Heritage at risk (bool, at-risk id)
-- e.g. https://historicengland.org.uk/advice/heritage-at-risk/search-register/list-entry/408684 -- e.g. https://historicengland.org.uk/advice/heritage-at-risk/search-register/list-entry/408684
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_heritage_at_risk_id int DEFAULT null; ALTER TABLE buildings
ADD COLUMN IF NOT EXISTS planning_heritage_at_risk_id int DEFAULT NULL;
-- World Heritage (id) -- World Heritage (id)
-- e.g. http://whc.unesco.org/en/list/488/ -- e.g. http://whc.unesco.org/en/list/488/
-- full list for London: 426, 488, 795, 1084 -- full list for London: 426, 488, 795, 1084
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_world_list_id int DEFAULT null; ALTER TABLE buildings
ADD COLUMN IF NOT EXISTS planning_world_list_id int DEFAULT NULL;
-- GLHER (bool, link) -- GLHER (bool, link)
-- e.g. http://www.heritagegateway.org.uk/Gateway/Results_Single.aspx?uid=2822047&resourceID=272 -- e.g. http://www.heritagegateway.org.uk/Gateway/Results_Single.aspx?uid=2822047&resourceID=272
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_in_glher boolean DEFAULT false; ALTER TABLE buildings
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_glher_url varchar DEFAULT ''; ADD COLUMN IF NOT EXISTS planning_in_glher boolean DEFAULT FALSE;
ALTER TABLE buildings
ADD COLUMN IF NOT EXISTS planning_glher_url VARCHAR DEFAULT '';
-- Archaeological Priority Area (bool, name, tier 1-4) -- Archaeological Priority Area (bool, name, tier 1-4)
-- see https://historicengland.org.uk/services-skills/our-planning-services/greater-london-archaeology-advisory-service/greater-london-archaeological-priority-areas/ -- see https://historicengland.org.uk/services-skills/our-planning-services/greater-london-archaeology-advisory-service/greater-london-archaeological-priority-areas/
-- (APA reports contain PDF maps) -- (APA reports contain PDF maps)
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_in_apa boolean DEFAULT false; ALTER TABLE buildings
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_apa_name varchar DEFAULT ''; ADD COLUMN IF NOT EXISTS planning_in_apa boolean DEFAULT FALSE;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_apa_tier smallint DEFAULT null;
ALTER TABLE buildings
ADD COLUMN IF NOT EXISTS planning_apa_name VARCHAR DEFAULT '';
ALTER TABLE buildings
ADD COLUMN IF NOT EXISTS planning_apa_tier smallint DEFAULT NULL;
-- Locally listed -- Locally listed
-- not usually given id or URL per-building: -- not usually given id or URL per-building:
-- e.g. https://lambeth.gov.uk/planning-and-building-control/building-conservation/find-out-if-an-asset-is-on-the-local-heritage -- e.g. https://lambeth.gov.uk/planning-and-building-control/building-conservation/find-out-if-an-asset-is-on-the-local-heritage
-- e.g. https://www.hackney.gov.uk/locally-listed-buildings -- e.g. https://www.hackney.gov.uk/locally-listed-buildings
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_in_local_list boolean DEFAULT false; ALTER TABLE buildings
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_local_list_url varchar DEFAULT ''; ADD COLUMN IF NOT EXISTS planning_in_local_list boolean DEFAULT FALSE;
ALTER TABLE buildings
ADD COLUMN IF NOT EXISTS planning_local_list_url VARCHAR DEFAULT '';
-- Historic Area Assessment (bool, URL) -- Historic Area Assessment (bool, URL)
-- if building falls within area of report? -- if building falls within area of report?
-- see https://historicengland.org.uk/images-books/publications/understanding-place-historic-area-assessments/ -- see https://historicengland.org.uk/images-books/publications/understanding-place-historic-area-assessments/
-- e.g. https://www.eustonareaplan.info/wp-content/uploads/2012/09/827_130624_Euston-Historic-Assessment_Final-Report_email.pdf -- e.g. https://www.eustonareaplan.info/wp-content/uploads/2012/09/827_130624_Euston-Historic-Assessment_Final-Report_email.pdf
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_in_historic_area_assessment boolean DEFAULT false; ALTER TABLE buildings
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_historic_area_assessment_url varchar DEFAULT ''; ADD COLUMN IF NOT EXISTS planning_in_historic_area_assessment boolean DEFAULT FALSE;
ALTER TABLE buildings
ADD COLUMN IF NOT EXISTS planning_historic_area_assessment_url VARCHAR DEFAULT '';