From 7369489b7a850fe2b2f3a7611f1ceeb5839d387d Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Sat, 18 Feb 2023 14:52:28 +0400 Subject: [PATCH] Remove column `parts.english_name` --- 20230218104748_remove_part_english_names.down.sql | 7 +++++++ 20230218104748_remove_part_english_names.up.sql | 3 +++ 2 files changed, 10 insertions(+) create mode 100644 20230218104748_remove_part_english_names.down.sql create mode 100644 20230218104748_remove_part_english_names.up.sql diff --git a/20230218104748_remove_part_english_names.down.sql b/20230218104748_remove_part_english_names.down.sql new file mode 100644 index 0000000..8182477 --- /dev/null +++ b/20230218104748_remove_part_english_names.down.sql @@ -0,0 +1,7 @@ +BEGIN; +ALTER TABLE parts ADD COLUMN english_name VARCHAR; +ALTER TABLE parts ADD CONSTRAINT english_name_is_sane_text + CHECK (english_name IS NULL OR is_sane_text(english_name)); +CREATE UNIQUE INDEX parts_language_english_name + ON parts (language_id, english_name); +COMMIT; diff --git a/20230218104748_remove_part_english_names.up.sql b/20230218104748_remove_part_english_names.up.sql new file mode 100644 index 0000000..a4f32cb --- /dev/null +++ b/20230218104748_remove_part_english_names.up.sql @@ -0,0 +1,3 @@ +BEGIN; +ALTER TABLE parts DROP COLUMN english_name; +COMMIT;