Fix/category default values (#451)

* Amend sustainability and type migrations

* Add DROP TYPE to down migrations
This commit is contained in:
mz8i 2019-10-02 16:47:17 +01:00 committed by GitHub
parent e7b7e3fe67
commit 14bc6e0d91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 4 deletions

View File

@ -26,3 +26,8 @@ ALTER TABLE buildings DROP COLUMN IF EXISTS sust_life_expectancy;
--Average lifespan of typology based on statistical analysis of similar stock --Average lifespan of typology based on statistical analysis of similar stock
ALTER TABLE buildings DROP COLUMN IF EXISTS sust_lifespan_average; ALTER TABLE buildings DROP COLUMN IF EXISTS sust_lifespan_average;
DROP TYPE IF EXISTS sust_breeam_rating;
DROP TYPE IF EXISTS sust_dec;
DROP TYPE IF EXISTS sust_aggregate_estimate_epc;

View File

@ -14,7 +14,7 @@ AS ENUM ('Outstanding',
'Unclassified'); 'Unclassified');
ALTER TABLE buildings ALTER TABLE buildings
ADD COLUMN IF NOT EXISTS sust_breeam_rating sust_breeam_rating DEFAULT 'Unclassified'; ADD COLUMN IF NOT EXISTS sust_breeam_rating sust_breeam_rating;
-- Date of BREEAM -- Date of BREEAM
ALTER TABLE buildings ALTER TABLE buildings

View File

@ -4,3 +4,5 @@ ALTER TABLE buildings DROP COLUMN IF EXISTS building_attachment_form;
-- [Disabled for launch] Date of change of use -- [Disabled for launch] Date of change of use
-- This needs to pair with demolition -- This needs to pair with demolition
ALTER TABLE buildings DROP COLUMN IF EXISTS date_change_building_use; ALTER TABLE buildings DROP COLUMN IF EXISTS date_change_building_use;
DROP TYPE IF EXISTS building_attachment_form;

View File

@ -3,11 +3,10 @@ CREATE TYPE building_attachment_form
AS ENUM ('Detached', AS ENUM ('Detached',
'Semi-Detached', 'Semi-Detached',
'End-Terrace', 'End-Terrace',
'Mid-Terrace', 'Mid-Terrace');
'Unknown');
ALTER TABLE buildings ALTER TABLE buildings
ADD COLUMN IF NOT EXISTS building_attachment_form building_attachment_form DEFAULT 'Unknown'; ADD COLUMN IF NOT EXISTS building_attachment_form building_attachment_form;
-- [Disabled for launch] Date of change of use -- [Disabled for launch] Date of change of use
-- This needs to pair with demolition -- This needs to pair with demolition