From 881f8512de802d2023d69b9d11482d4e976e5ded Mon Sep 17 00:00:00 2001 From: Dominic H Date: Thu, 15 Aug 2019 15:08:02 +0100 Subject: [PATCH] WIP for #362 --- migrations/013.team.down.sql | 12 ++++++++++++ migrations/014.team.up.sql | 18 ++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 migrations/013.team.down.sql create mode 100644 migrations/014.team.up.sql diff --git a/migrations/013.team.down.sql b/migrations/013.team.down.sql new file mode 100644 index 00000000..16c6500d --- /dev/null +++ b/migrations/013.team.down.sql @@ -0,0 +1,12 @@ +-- Remove team fields, update in paralell with adding new fields + +-- Award or awards (may be multiple) stored as json b object +ALTER TABLE buildings DROP COLUMN IF EXISTS team_awards; + +--TODO: Original building architect + +--TODO : Original building engineer + +--TODO : Original building contractor + +--TODO : Original building developer diff --git a/migrations/014.team.up.sql b/migrations/014.team.up.sql new file mode 100644 index 00000000..1474fccc --- /dev/null +++ b/migrations/014.team.up.sql @@ -0,0 +1,18 @@ +-- Remove team fields, update in paralell with adding new fields + +-- Award or awards (may be multiple) any of stored as json b object +ALTER TABLE buildings DROP COLUMN IF EXISTS team_awards; + +-- Building award, any of: +-- TBC might be table + +CREATE TYPE team_awards +AS ENUM ('RIBA Gold mdeal', + 'RIBA Sitrling prize', + 'RIBA Regional award', + 'The Civic Trust Award', + 'Pass', + 'None'); + +ALTER TABLE buildings + ADD COLUMN IF NOT EXISTS team_awards team_awards DEFAULT 'None';