1
0
Fork 0
database/20230218104748_remove_part_english_names.down.sql

8 lines
279 B
MySQL
Raw Normal View History

2023-02-18 05:52:28 -05:00
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;