--ABS-85330
--- CUSTOMERCREDITCARD ---
CREATE TABLE CUSTOMERCREDITCARD
(
CUSTOMER_ID NUMBER NOT NULL,
TOKEN VARCHAR2(25) NULL,
CARDNUMBER VARCHAR2(20) NULL,
CARDEXPIRYDATE VARCHAR2(4) NULL,
TOKENCREATEDATE DATE NULL,
TOKENEXPIRYDATE DATE NULL,
LENGTHSTRING1 NUMBER NULL,
LENGTHSTRING2 NUMBER NULL,
STRING1DATA VARCHAR2(50) NULL,
STRING2DATA VARCHAR2(50) NULL,
STRING1ENCRYPTED VARCHAR2(48) NULL,
DEVICESERIALNUMBER VARCHAR2(20) NULL,
KSN VARCHAR2(10) NULL,
SYSTEMUSER_ID NUMBER NOT NULL,
TIMESTAMP DATE NOT NULL
);

COMMENT ON COLUMN CUSTOMERCREDITCARD.CARDNUMBER IS 'Note, this is masked data, not full card number';

ALTER TABLE CUSTOMERCREDITCARD ADD CONSTRAINT XPKCUSTOMERCREDITCARD PRIMARY KEY (CUSTOMER_ID);

ALTER TABLE CUSTOMERCREDITCARD ADD CONSTRAINT FK_CUSTOMERCREDITCARD_CID FOREIGN KEY (CUSTOMER_ID)
REFERENCES CUSTOMER (CUSTOMER_ID) ON DELETE CASCADE;

--- RESPONSECODETRANSLATION ---
CREATE TABLE RESPONSECODETRANSLATION
(
RESPONSECODE NUMBER NOT NULL,
DESCRIPTION VARCHAR2(250) NOT NULL,
REMARK VARCHAR2(250) NULL,
SYSTEMUSER_ID NUMBER NOT NULL,
TIMESTAMP DATE NOT NULL
);

ALTER TABLE RESPONSECODETRANSLATION ADD CONSTRAINT XPKRESPONSECODETRANSLATION PRIMARY KEY (RESPONSECODE);