colouring-montreal/migrations/011.sustainability.down.sql

34 lines
1.3 KiB
MySQL
Raw Normal View History

2023-01-04 07:17:56 -05:00
-- Remove sustainability fields, update in parallel 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;
2023-01-04 07:17:56 -05:00
-- DEC (display energy certificate, 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;
2023-01-04 07:17:56 -05:00
--DEC certificate lmk key, this would be lmkkey, no online lookup but can scrape through API. Numeric (25)
2019-08-29 11:13:09 -04:00
ALTER TABLE buildings DROP COLUMN IF EXISTS sust_dec_lmkey;
-- 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;
2019-08-29 11:13:09 -04:00
--How much embodied carbon? One for ML, tons CO2 int
ALTER TABLE buildings DROP COLUMN IF EXISTS sust_embodied_carbon;
2019-08-29 11:13:09 -04:00
--Life expectancy of the building, via further analysis
ALTER TABLE buildings DROP COLUMN IF EXISTS sust_life_expectancy;
2019-08-29 11:13:09 -04:00
--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;