-- ABS-64243/ ABS-65510

ALTER TABLE CONTRACT ADD (SALESEMPLOYEE2_ID NUMBER NULL,
                          SALESEMPLOYEE1PERCENTAGE NUMBER DEFAULT 0 NOT NULL
                                               CONSTRAINT SALESEMPLOYEE1PERC_VALID1_1 CHECK (SALESEMPLOYEE1PERCENTAGE BETWEEN 0 AND 100),
                          SALESEMPLOYEE2PERCENTAGE NUMBER DEFAULT 0 NOT NULL
                                               CONSTRAINT SALESEMPLOYEE2PERC_VALID1_2 CHECK (SALESEMPLOYEE2PERCENTAGE BETWEEN 0 AND 100));


CREATE INDEX XIF21CONTRACT ON CONTRACT (SALESEMPLOYEE2_ID ASC);

ALTER TABLE CONTRACT
  ADD CONSTRAINT CONTRACT_SALESEMPLOYEE2 FOREIGN KEY (SALESEMPLOYEE2_ID)
  REFERENCES EMPLOYEE (EMPLOYEE_ID);