parent
47f4cacb3f
commit
35f6eebeb6
26
migrations/011.sustainability.down.sql
Normal file
26
migrations/011.sustainability.down.sql
Normal file
@ -0,0 +1,26 @@
|
||||
-- Remove sustainability fields, update in paralell with adding new fields
|
||||
-- BREEAM rating
|
||||
ALTER TABLE buildings DROP COLUMN IF EXISTS sust_breeam_rating;
|
||||
-- BREEAM date
|
||||
ALTER TABLE buildings DROP COLUMN IF EXISTS sust_breeam_date;
|
||||
|
||||
-- DEC (display energy certifcate, only applies to non domestic buildings)
|
||||
ALTER TABLE buildings DROP COLUMN IF EXISTS sust_dec;
|
||||
-- DEC date
|
||||
ALTER TABLE buildings DROP COLUMN IF EXISTS sust_dec_date;
|
||||
|
||||
--TODO: DEC certifcate number, is there an online store for these?
|
||||
|
||||
-- Aggregate EPC rating (Estimated) for a building, derived from inidividual certificates
|
||||
ALTER TABLE buildings DROP COLUMN IF EXISTS sust_aggregate_estimate_epc;
|
||||
|
||||
-- Last significant retrofit date YYYY
|
||||
ALTER TABLE buildings DROP COLUMN IF EXISTS sust_retrofit_date;
|
||||
|
||||
--TODO : Embodied carbon
|
||||
|
||||
--TODO : Life expectancy minimum
|
||||
|
||||
--TODO : Average lifespan for typology
|
||||
|
||||
--TODO : Adaptability rating
|
58
migrations/012.sustainability.up.sql
Normal file
58
migrations/012.sustainability.up.sql
Normal file
@ -0,0 +1,58 @@
|
||||
-- BREEAM ratings, one of:
|
||||
-- - Outstanding
|
||||
-- - Excellent
|
||||
-- - Very good
|
||||
-- - Good
|
||||
-- - Pass
|
||||
-- - Unclassified
|
||||
CREATE TYPE sust_breeam_rating
|
||||
AS ENUM ('Outstanding',
|
||||
'Excellent',
|
||||
'Very good',
|
||||
'Good',
|
||||
'Pass',
|
||||
'Unclassified');
|
||||
|
||||
ALTER TABLE buildings
|
||||
ADD COLUMN IF NOT EXISTS sust_breeam_rating sust_breeam_rating DEFAULT 'Unclassified';
|
||||
|
||||
-- Date of BREEAM
|
||||
ALTER TABLE buildings
|
||||
ADD COLUMN IF NOT EXISTS sust_breeam_date smallint;
|
||||
|
||||
-- DEC (display energy certifcate, only applies to non domestic buildings)
|
||||
-- A - G
|
||||
CREATE TYPE sust_dec
|
||||
AS ENUM ('A',
|
||||
'B',
|
||||
'C',
|
||||
'D',
|
||||
'E',
|
||||
'F',
|
||||
'G');
|
||||
|
||||
-- Date of DEC YYYY
|
||||
ALTER TABLE buildings
|
||||
ADD COLUMN IF NOT EXISTS sust_dec_date smallint;
|
||||
|
||||
|
||||
ALTER TABLE buildings
|
||||
ADD COLUMN IF NOT EXISTS sust_dec sust_dec;
|
||||
|
||||
-- Aggregate EPC rating (Estimated) for a building, derived from inidividual certificates
|
||||
-- A+ - G
|
||||
CREATE TYPE sust_aggregate_estimate_epc
|
||||
AS ENUM ('A',
|
||||
'B',
|
||||
'C',
|
||||
'D',
|
||||
'E',
|
||||
'F',
|
||||
'G');
|
||||
|
||||
ALTER TABLE buildings
|
||||
ADD COLUMN IF NOT EXISTS sust_aggregate_estimate_epc sust_aggregate_estimate_epc;
|
||||
|
||||
-- Last significant retrofit date YYYY
|
||||
ALTER TABLE buildings
|
||||
ADD COLUMN IF NOT EXISTS sust_retrofit_date smallint;
|
Loading…
Reference in New Issue
Block a user