Merge pull request #431 from tomalrussell/feature/migrations_type

Feature/migrations type
This commit is contained in:
dominic 2019-10-01 16:18:35 +01:00 committed by GitHub
commit b5e6b41270
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 0 deletions

View File

@ -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;

View File

@ -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 ('Detached',
'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;