From 60c0b2d775565fe149c98c29e1ece3ff404adba7 Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Sun, 19 Feb 2023 08:58:03 +0400 Subject: [PATCH] Add column `words.commentary` --- 20230219045623_word_commentary.down.sql | 3 +++ 20230219045623_word_commentary.up.sql | 5 +++++ 2 files changed, 8 insertions(+) create mode 100644 20230219045623_word_commentary.down.sql create mode 100644 20230219045623_word_commentary.up.sql diff --git a/20230219045623_word_commentary.down.sql b/20230219045623_word_commentary.down.sql new file mode 100644 index 0000000..45746b2 --- /dev/null +++ b/20230219045623_word_commentary.down.sql @@ -0,0 +1,3 @@ +BEGIN; +ALTER TABLE words DROP COLUMN commentary; +COMMIT; diff --git a/20230219045623_word_commentary.up.sql b/20230219045623_word_commentary.up.sql new file mode 100644 index 0000000..40ba450 --- /dev/null +++ b/20230219045623_word_commentary.up.sql @@ -0,0 +1,5 @@ +BEGIN; +ALTER TABLE words ADD COLUMN commentary TEXT; +ALTER TABLE words ADD CONSTRAINT commentary_is_sane_text + CHECK (is_sane_text(commentary)); +COMMIT;