--ABS-154228

--CUSTOMERPURCHASEORDER TABLE
CREATE TABLE CUSTOMERPURCHASEORDER(
CUSTOMER_ID         NUMBER NOT NULL,
PURCHASEORDERNUMBER VARCHAR2(30) NOT NULL,
SYSTEMUSER_ID       NUMBER NOT NULL,
TIMESTAMP           DATE NOT NULL);

ALTER TABLE CUSTOMERPURCHASEORDER ADD CONSTRAINT XPKCUSTOMERPURCHASEORDER PRIMARY KEY (CUSTOMER_ID);

CREATE INDEX XIF1CUSTOMERPURCHASEORDER ON CUSTOMERPURCHASEORDER (CUSTOMER_ID ASC);

ALTER TABLE CUSTOMERPURCHASEORDER
ADD CONSTRAINT FK_CUSTOMERPURCHASEORDER_CUSTOMER_ID FOREIGN KEY (CUSTOMER_ID) REFERENCES CUSTOMER(CUSTOMER_ID) ON DELETE CASCADE;
