From ea150250a3108d0a04207cfa4e5bc0e9ef594a8a Mon Sep 17 00:00:00 2001 From: Dominic H Date: Tue, 1 Oct 2019 16:30:15 +0100 Subject: [PATCH] File naming consistency Sequential numbering for migrations - Also removed sustainability-up-extras as original sustainbility file had not been run --- migrations/011.sustainability-extra.up.sql | 67 ------------------- .../{014.type.down.sql => 012.type.down.sql} | 0 .../{014.type.up.sql => 012.type.up.sql} | 0 3 files changed, 67 deletions(-) delete mode 100644 migrations/011.sustainability-extra.up.sql rename migrations/{014.type.down.sql => 012.type.down.sql} (100%) rename migrations/{014.type.up.sql => 012.type.up.sql} (100%) diff --git a/migrations/011.sustainability-extra.up.sql b/migrations/011.sustainability-extra.up.sql deleted file mode 100644 index 854d61f2..00000000 --- a/migrations/011.sustainability-extra.up.sql +++ /dev/null @@ -1,67 +0,0 @@ --- 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; - ---How much embodied carbon? One for ML, tons CO2 int -ALTER TABLE buildings ADD COLUMN IF NOT EXISTS sust_embodied_carbon numeric(7,2); - ---Life expectancy of the building, via further analysis -ALTER TABLE buildings ADD COLUMN IF NOT EXISTS sust_life_expectancy smallint; - ---Average lifespan of typology based on statistical analysis of similar stock -ALTER TABLE buildings ADD COLUMN IF NOT EXISTS sust_lifespan_average smallint; diff --git a/migrations/014.type.down.sql b/migrations/012.type.down.sql similarity index 100% rename from migrations/014.type.down.sql rename to migrations/012.type.down.sql diff --git a/migrations/014.type.up.sql b/migrations/012.type.up.sql similarity index 100% rename from migrations/014.type.up.sql rename to migrations/012.type.up.sql