1
0
Fork 0

Add column `word_form_example_texts.pos`

This commit is contained in:
Alex Kotov 2023-02-20 12:48:00 +04:00
parent bbc272d5ef
commit b09972a08c
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
4 changed files with 14 additions and 0 deletions

View File

@ -0,0 +1 @@
ALTER TABLE word_form_example_texts DROP COLUMN pos;

View File

@ -0,0 +1 @@
ALTER TABLE word_form_example_texts ADD COLUMN pos INTEGER;

View File

@ -0,0 +1,5 @@
BEGIN;
ALTER TABLE word_form_example_texts ALTER COLUMN pos DROP NOT NULL;
ALTER TABLE word_form_example_texts DROP CONSTRAINT pos_is_not_negative;
DROP INDEX word_form_example_texts_pos;
COMMIT;

View File

@ -0,0 +1,7 @@
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;