7 lines
278 B
PL/PgSQL
7 lines
278 B
PL/PgSQL
BEGIN;
|
|
ALTER TABLE word_form_example_texts ALTER COLUMN pos SET NOT NULL;
|
|
ALTER TABLE word_form_example_texts ADD CONSTRAINT pos_is_not_negative
|
|
CHECK (pos >= 0);
|
|
CREATE UNIQUE INDEX word_form_example_texts_pos
|
|
ON word_form_example_texts (example_text_id, pos);
|
|
COMMIT;
|