Add column word_form_example_texts.pos
This commit is contained in:
parent
bbc272d5ef
commit
b09972a08c
4 changed files with 14 additions and 0 deletions
1
20230220084107_word_form_example_texts_pos.down.sql
Normal file
1
20230220084107_word_form_example_texts_pos.down.sql
Normal file
|
@ -0,0 +1 @@
|
|||
ALTER TABLE word_form_example_texts DROP COLUMN pos;
|
1
20230220084107_word_form_example_texts_pos.up.sql
Normal file
1
20230220084107_word_form_example_texts_pos.up.sql
Normal file
|
@ -0,0 +1 @@
|
|||
ALTER TABLE word_form_example_texts ADD COLUMN pos INTEGER;
|
5
20230220084415_word_form_example_texts_validate.down.sql
Normal file
5
20230220084415_word_form_example_texts_validate.down.sql
Normal 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;
|
7
20230220084415_word_form_example_texts_validate.up.sql
Normal file
7
20230220084415_word_form_example_texts_validate.up.sql
Normal 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;
|
Loading…
Reference in a new issue