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

7 lines
279 B
PL/PgSQL

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;