-- ABS-64225 / ABS-70159

----------------------- CUSTOMERRESIDENTIALSETTINGS -----------------------
ALTER TABLE CUSTOMERRESIDENTIALSETTINGS ADD (ALLOWREPAIR NUMBER DEFAULT 0 NOT NULL CONSTRAINT ALLOWREPAIR_VALID1_1
                                            CHECK (ALLOWREPAIR IN (0,1,2))) ;

COMMENT ON COLUMN CUSTOMERRESIDENTIALSETTINGS.ALLOWREPAIR
  IS '0 = Repair is not allowed (for all clients)
1 = Repair is allowed (for all clients)
2 = Specified per client';

----------------------- CLIENT -----------------------
ALTER TABLE CLIENT ADD (ALLOWREPAIR NUMBER DEFAULT 0 NOT NULL 
                       CONSTRAINT ALLOWREPAIR_VALID1_2 CHECK (ALLOWREPAIR IN (0,1,2))) ;
 
COMMENT ON COLUMN CLIENT.ALLOWREPAIR
  IS '0 = Not applicable / Defined on Customer
1 = Repair Not Allowed
2 = Repair Allowed';

----------------------- AUTOMATICFLAG -----------------------
INSERT INTO AUTOMATICFLAG
      (AUTOMATICFLAG_ID,
       EVENT,
       SYSTEMUSER_ID,
       TIMESTAMP,
       SELECTABLE,
       DELETABLE,
       TRANSFERABLE,
       FLAGTYPE)
    VALUES
      (SEQ_AUTOMATICFLAG.NEXTVAL,
       'Repair',
       GETMINSYSTEMUSER(),
       SYSDATE,
       'Y',
       'Y',
       'Y',
       4);
       
COMMIT;
