-- ABS-79187 / ABS-84254

----------------- WORKORDER ------------------

ALTER TABLE WORKORDER ADD (MINSPECIALGRADE_ID NUMBER NULL);

COMMENT ON COLUMN WORKORDER.MINSPECIALGRADE_ID
IS 'only be used for personalized garment work orders. When filled it indicates the minimum grade for all items that will be ordered via this personalized garment work order';

CREATE INDEX XIF35WORKORDER ON WORKORDER (MINSPECIALGRADE_ID ASC);

ALTER TABLE WORKORDER ADD CONSTRAINT FK_WORKORDER_MINSPECIALGRADEID
FOREIGN KEY(MINSPECIALGRADE_ID)
REFERENCES QUALITYGRADE(QUALITYGRADE_ID) ON DELETE SET NULL;

