--ABS-164939
ALTER TABLE A_TABLELIST ADD 
(AUDIT_PURPOSE NUMBER(1) DEFAULT 1 NOT NULL,
 REMARK VARCHAR2(1000) NULL,
 AUDIT_STARTDATE DATE NULL,
 AUDIT_ENDDATE DATE NULL,
 SYSTEMUSER_ID NUMBER DEFAULT 1 NOT NULL,
 TIMESTAMP DATE DEFAULT SYSDATE NOT NULL);
COMMENT ON COLUMN A_TABLELIST.HISTORY_DAYS IS 'Days to view. The number of days the we look back in the audit trail dialog';
COMMENT ON COLUMN A_TABLELIST.AUDIT_PURPOSE IS '1=Internal, 2=External, 3=ABS Service desk';
COMMENT ON COLUMN A_TABLELIST.AUDIT_STARTDATE IS 'Optional audit start date';
COMMENT ON COLUMN A_TABLELIST.AUDIT_ENDDATE IS 'Optional audit end date';
ALTER TABLE A_TABLELIST ADD CONSTRAINT CHK_INDX_A_TABLELIST_AUDIT_PURPOSE CHECK (AUDIT_PURPOSE IN (1,2,3));
ALTER TABLE A_TABLELIST ADD CONSTRAINT CHK_INDX_A_TABLELIST_DATECHECK CHECK ((AUDIT_STARTDATE < AUDIT_ENDDATE OR AUDIT_STARTDATE = TO_DATE('31-12-2099','DD-MM-YYYY')));
