-- ABS-10055
-----------------   RESERVEBOXESINBATCH   ---------------------
CREATE TABLE RESERVEBOXESINBATCH
(
BATCH_ID NUMBER NOT NULL,
CLIENT_ID NUMBER NOT NULL,
SYSTEMUSER_ID NUMBER NOT NULL,
TIMESTAMP DATE NOT NULL
);

ALTER TABLE RESERVEBOXESINBATCH ADD CONSTRAINT XPKRESERVEBOXESINBATCH PRIMARY KEY (BATCH_ID, CLIENT_ID);

CREATE INDEX XIF1RESERVEBOXESINBATCH ON RESERVEBOXESINBATCH (BATCH_ID ASC);

CREATE INDEX XIF2RESERVEBOXESINBATCH ON RESERVEBOXESINBATCH (CLIENT_ID ASC);

ALTER TABLE RESERVEBOXESINBATCH ADD CONSTRAINT RESERVEBOXESINBATCH_BATCH_ID FOREIGN KEY
(BATCH_ID) REFERENCES BATCH (BATCH_ID) ON DELETE CASCADE;

ALTER TABLE RESERVEBOXESINBATCH ADD CONSTRAINT RESERVEBOXESINBATCH_CLIENT_ID FOREIGN KEY
(CLIENT_ID) REFERENCES CLIENT (CLIENT_ID) ON DELETE CASCADE;