--ABS-126149
ALTER TABLE A_TABLELIST ADD
 (STARTWITHCOPY VARCHAR2(1) DEFAULT 'Y' NOT NULL,
  TABLE_DESC VARCHAR2(30) NULL,
  HISTORY_DAYS NUMBER NULL,
  VIEW_TXT CLOB NULL);
COMMENT ON COLUMN A_TABLELIST.STARTWITHCOPY
  IS 'Start Y(es) or N(o) with a full table copy. For production tables you might want to use N';
COMMENT ON COLUMN A_TABLELIST.TABLE_DESC
  IS 'Optional different table description';
COMMENT ON COLUMN A_TABLELIST.HISTORY_DAYS
  IS 'Report historical days to look back';
COMMENT ON COLUMN A_TABLELIST.VIEW_TXT
  IS 'For AUDIT report functionality store we will store the view here';

DROP TYPE T_AUDIT_TAB;
DROP TYPE T_AUDIT;

CREATE TYPE T_AUDIT AS OBJECT (
  TABLE_NAME VARCHAR2(100),
  IDENTITY_ID VARCHAR2(1000),
  TIMESTAMP DATE,
  ACTION VARCHAR2(1000),
  COLUMN_NAME VARCHAR2(100),
  OLD_VALUE VARCHAR2(1000),
  NEW_VALUE VARCHAR2(1000),
  BUSINESSUNIT_CODE VARCHAR2(6),
  BUSINESSUNIT_DESC VARCHAR2(40),
  SYSUSER VARCHAR2(1000),
  WORKSTATION VARCHAR2(40),
  EXTRAFIELD1 VARCHAR2(1000),
  EXTRAFIELD2 VARCHAR2(1000),
  EXTRAFIELD3 VARCHAR2(1000),
  EXTRAFIELD4 VARCHAR2(1000),
  EXTRAFIELD5 VARCHAR2(1000),
  EXTRAFIELD6 VARCHAR2(1000),
  ROWNUMBER VARCHAR2(1000));

CREATE TYPE T_AUDIT_TAB IS TABLE OF T_AUDIT;
