From c30ffda338ab2b5302627fe9f641089f9e95dac5 Mon Sep 17 00:00:00 2001 From: Tom Russell Date: Sat, 19 Jan 2019 17:46:51 +0000 Subject: [PATCH] Add date details migrations --- migrations/007.date-details.down.sql | 4 ++++ migrations/007.date-details.up.sql | 10 ++++++++++ 2 files changed, 14 insertions(+) create mode 100644 migrations/007.date-details.down.sql create mode 100644 migrations/007.date-details.up.sql diff --git a/migrations/007.date-details.down.sql b/migrations/007.date-details.down.sql new file mode 100644 index 00000000..3edaec9d --- /dev/null +++ b/migrations/007.date-details.down.sql @@ -0,0 +1,4 @@ +-- Remove source details and links + +ALTER TABLE buildings DROP COLUMN IF EXISTS date_source_detail; +ALTER TABLE buildings DROP COLUMN IF EXISTS date_link; diff --git a/migrations/007.date-details.up.sql b/migrations/007.date-details.up.sql new file mode 100644 index 00000000..3d2c698f --- /dev/null +++ b/migrations/007.date-details.up.sql @@ -0,0 +1,10 @@ +-- +-- Source details and links +-- + +-- Create date source details +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS date_source_detail varchar; +ALTER TABLE buildings ADD CONSTRAINT buildings_date_source_detail_len CHECK (length(date_source_detail) < 500); + +-- Create list of links +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS date_link text[];