--order 502531

ALTER TABLE PURCHASEREQUEST ADD ( PRIORITY NUMBER DEFAULT 2 NOT NULL );

COMMENT ON COLUMN PURCHASEREQUEST.PRIORITY IS '1 = Replacement purchase request
2 = Others
3 = Direct orders';

DROP INDEX XAK1PURCHASEREQUEST;

CREATE UNIQUE INDEX XAK1PURCHASEREQUEST ON PURCHASEREQUEST
(
	STOCKROOM_ID, 
	SUPPLIER_ID, 
	CUSTOMER_ID, 
	PRODUCT_ID, 
	SIZEDEFINITION_ID,
	REQUESTEDGRADE_ID,
	PRIORITY
);

ALTER TABLE PURCHASEORDERHEADER ADD ( PRIORITY NUMBER DEFAULT 2 NOT NULL );

COMMENT ON COLUMN PURCHASEORDERHEADER.PRIORITY IS '1 = Replacement purchase order
2 = Others
3 = Direct orders';