Add column inflections.index
This commit is contained in:
parent
cfa8d26d49
commit
da1407ea50
4 changed files with 12 additions and 0 deletions
1
20230324233151_inflections_index.down.sql
Normal file
1
20230324233151_inflections_index.down.sql
Normal file
|
@ -0,0 +1 @@
|
|||
ALTER TABLE inflections DROP COLUMN index;
|
1
20230324233151_inflections_index.up.sql
Normal file
1
20230324233151_inflections_index.up.sql
Normal file
|
@ -0,0 +1 @@
|
|||
ALTER TABLE inflections ADD COLUMN index BIGINT;
|
|
@ -0,0 +1,5 @@
|
|||
BEGIN;
|
||||
ALTER TABLE inflections ALTER COLUMN index DROP NOT NULL;
|
||||
ALTER TABLE inflections DROP CONSTRAINT index_is_not_negative;
|
||||
DROP INDEX inflections_part_id_index;
|
||||
COMMIT;
|
5
20230324233457_inflections_index_notnull_positive.up.sql
Normal file
5
20230324233457_inflections_index_notnull_positive.up.sql
Normal file
|
@ -0,0 +1,5 @@
|
|||
BEGIN;
|
||||
ALTER TABLE inflections ALTER COLUMN index SET NOT NULL;
|
||||
ALTER TABLE inflections ADD CONSTRAINT index_is_not_negative CHECK (index >= 0);
|
||||
CREATE UNIQUE INDEX inflections_part_id_index ON inflections (part_id, index);
|
||||
COMMIT;
|
Loading…
Reference in a new issue