Fix/category default values (#451)
* Amend sustainability and type migrations * Add DROP TYPE to down migrations
This commit is contained in:
parent
e7b7e3fe67
commit
14bc6e0d91
@ -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
|
||||
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;
|
||||
|
@ -14,7 +14,7 @@ AS ENUM ('Outstanding',
|
||||
'Unclassified');
|
||||
|
||||
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
|
||||
ALTER TABLE buildings
|
||||
|
@ -4,3 +4,5 @@ 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;
|
||||
|
||||
DROP TYPE IF EXISTS building_attachment_form;
|
||||
|
@ -3,11 +3,10 @@ CREATE TYPE building_attachment_form
|
||||
AS ENUM ('Detached',
|
||||
'Semi-Detached',
|
||||
'End-Terrace',
|
||||
'Mid-Terrace',
|
||||
'Unknown');
|
||||
'Mid-Terrace');
|
||||
|
||||
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
|
||||
-- This needs to pair with demolition
|
||||
|
Loading…
Reference in New Issue
Block a user