From 9ae355f105bcdcf61a53f0f65c21b27e65fe5780 Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Sat, 18 Feb 2023 17:39:25 +0400 Subject: [PATCH] Add column `translation_texts.commentary` --- 20230218130437_translations.up.sql | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/20230218130437_translations.up.sql b/20230218130437_translations.up.sql index e04c033..e925664 100644 --- a/20230218130437_translations.up.sql +++ b/20230218130437_translations.up.sql @@ -16,9 +16,12 @@ CREATE TABLE translation_texts ( translation_id BIGINT NOT NULL REFERENCES translations (id), lang_id BIGINT NOT NULL REFERENCES languages (id), value TEXT NOT NULL, + commentary TEXT, --- CONSTRAINT name CHECK (condition) - CONSTRAINT value_is_sane_text CHECK (is_sane_text(value)) +-- CONSTRAINT name CHECK (condition) + CONSTRAINT value_is_sane_text CHECK (is_sane_text(value)), + CONSTRAINT commentary_is_sane_text CHECK (commentary IS NULL OR + is_sane_text(commentary)) ); CREATE UNIQUE INDEX translations_word_index ON translations (word_id, index);