--ABS-120094
CREATE TABLE INVOICEMESSAGES
(
  CUSTOMER_ID       NUMBER NOT NULL,
  PRICEINCREASEDATE DATE DEFAULT TRUNC(SYSDATE) NOT NULL,
  MESSAGE           VARCHAR2(300) NOT NULL,
  STARTDATE         DATE NULL,
  ENDDATE           DATE NULL,
  SYSTEMUSER_ID     NUMBER DEFAULT 0 NOT NULL,
  TIMESTAMP         DATE DEFAULT SYSDATE NOT NULL
);
ALTER TABLE INVOICEMESSAGES
  ADD CONSTRAINT XPKINVOICEMESSAGES PRIMARY KEY (CUSTOMER_ID, PRICEINCREASEDATE);
CREATE INDEX XIE01INVOICEMESSAGES ON INVOICEMESSAGES (CUSTOMER_ID);
CREATE INDEX XIE02INVOICEMESSAGES ON INVOICEMESSAGES (CUSTOMER_ID, STARTDATE, ENDDATE);
ALTER TABLE INVOICEMESSAGES
  ADD CONSTRAINT FK_INVOICEMESSAGES_CUST FOREIGN KEY (CUSTOMER_ID)
  REFERENCES CUSTOMER_LINK (CUSTOMER_LINK_ID) ON DELETE CASCADE;
