1
0
Fork 0

Translate parts of speech

This commit is contained in:
Alex Kotov 2023-02-18 14:07:01 +04:00
parent 60502f9b77
commit 1c84d9deb4
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
2 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,3 @@
BEGIN;
DROP TABLE part_names;
COMMIT;

View File

@ -0,0 +1,19 @@
BEGIN;
CREATE TABLE part_names (
-- name type constraints
id BIGSERIAL PRIMARY KEY,
part_id BIGINT NOT NULL REFERENCES parts (id),
name_lang_id BIGINT NOT NULL REFERENCES languages (id),
value VARCHAR NOT NULL,
-- CONSTRAINT name CHECK (condition)
CONSTRAINT value_is_sane_text CHECK (is_sane_text(value))
);
CREATE UNIQUE INDEX part_names_part_name_lang
ON part_names (part_id, name_lang_id);
CREATE UNIQUE INDEX part_names_name_lang_value
ON part_names (name_lang_id, value);
COMMIT;