From 4a7eb350f2a64b3e82ed831c67f8bc8b09519351 Mon Sep 17 00:00:00 2001 From: dominic Date: Fri, 30 Aug 2019 13:37:56 +0100 Subject: [PATCH] WIP for #363 - Needs landuse table from #358 --- migrations/014.type.down.sql | 9 +++++++++ migrations/014.type.up.sql | 19 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 migrations/014.type.down.sql create mode 100644 migrations/014.type.up.sql diff --git a/migrations/014.type.down.sql b/migrations/014.type.down.sql new file mode 100644 index 00000000..776a86d3 --- /dev/null +++ b/migrations/014.type.down.sql @@ -0,0 +1,9 @@ +--Original building use, this is same NLUD fields as current building use +ALTER TABLE buildings DROP COLUMN IF EXISTS original_building_use; + +-- Building attachment, ENUM: Detached, Semi-detached, End-Terrace, Mid-Terrace +ALTER TABLE buildings DROP COLUMN IF EXISTS building_attachment_form; + +-- [Disabled for launch] Date of change of use +-- This needs to pair with demolition +ALTER TABLE buildings DROP COLUMN IF EXISTS date_change_building_use; diff --git a/migrations/014.type.up.sql b/migrations/014.type.up.sql new file mode 100644 index 00000000..6326efdb --- /dev/null +++ b/migrations/014.type.up.sql @@ -0,0 +1,19 @@ +--Original building use, this is same NLUD fields as current building use +ALTER TABLE buildings + ADD COLUMN IF NOT EXISTS original_building_use; + +-- Building attachment, ENUM: Detached, Semi-detached, End-Terrace, Mid-Terrace +CREATE TYPE building_attachment_form +AS ENUM ('Deatched', + 'Semi-Detached', + 'End-Terrace', + 'Mid-Terrace', + 'Unknown'); + +ALTER TABLE buildings + ADD COLUMN IF NOT EXISTS building_attachment_form building_attachment_form DEFAULT 'Unknown'; + +-- [Disabled for launch] Date of change of use +-- This needs to pair with demolition +ALTER TABLE buildings + ADD COLUMN IF NOT EXISTS date_change_building_use smallint;