7 lines
279 B
PL/PgSQL
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;
|