1
0
Fork 0
database/20230324233457_inflections_index_notnull_positive.up.sql

6 lines
232 B
MySQL
Raw Normal View History

2023-03-24 19:37:17 -04:00
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;