-- ABS-40498
-------------- ALLOCATIONTRANSACTIONPDA --------------

CREATE TABLE ALLOCATIONTRANSACTIONPDA
( ALLOCATIONTRANSACTION_ID NUMBER NOT NULL,
  PDATIMESTAMP             DATE NOT NULL,
  SYSTEMUSER_ID            NUMBER NOT NULL,
  TIMESTAMP                DATE NOT NULL);

CREATE INDEX XIF1ALLOCATIONTRANSACTIONPDA ON ALLOCATIONTRANSACTIONPDA (ALLOCATIONTRANSACTION_ID ASC);

ALTER TABLE ALLOCATIONTRANSACTIONPDA
  ADD CONSTRAINT XPKALLOCATIONTRANSACTIONPDA PRIMARY KEY (ALLOCATIONTRANSACTION_ID, PDATIMESTAMP);
  
ALTER TABLE ALLOCATIONTRANSACTIONPDA
  ADD CONSTRAINT ALLOCATIONTRANSACTIONPDA_AT FOREIGN KEY (ALLOCATIONTRANSACTION_ID)
  REFERENCES ALLOCATIONTRANSACTION (ALLOCATIONTRANSACTION_ID) ON DELETE CASCADE;



