--UPDATE FROM 8.6.0.3 TO 8.6.0.4


DROP TABLE VERSION_8_6_0_3;



/*  VERSION_8_6_0_4  */
CREATE TABLE VERSION_8_6_0_4 (
	 DUMMY	NUMBER	    NULL
)
;

create table ZWRL (
	ZWRL_ID NUMBER(30,0) not null,
	ZWRL_ZFAG_ID NUMBER(30,0) not null,
	ZWRL_ZWIT_ID NUMBER(30,0) not null,
	ZWRL_MONTHLYAMOUNT NUMBER(30,4) null,
	ZWRL_CO_ZDCO_ID NUMBER(30,0) null,
	ZWRL_TR_ZDCO_ID NUMBER(30,0) null,
	ZWRL_OP_ZDCO_ID NUMBER(30,0) null,
	ZWRL_TRANSFER_MONTH1 NUMBER(1,0) not null,
	ZWRL_TRANSFER_MONTH2 NUMBER(1,0) not null,
	ZWRL_TRANSFER_MONTH3 NUMBER(1,0) not null,
	ZWRL_TRANSFER_MONTH4 NUMBER(1,0) not null,
	ZWRL_TRANSFER_MONTH5 NUMBER(1,0) not null,
	ZWRL_TRANSFER_MONTH6 NUMBER(1,0) not null,
	ZWRL_TRANSFER_MONTH7 NUMBER(1,0) not null,
	ZWRL_TRANSFER_MONTH8 NUMBER(1,0) not null,
	ZWRL_TRANSFER_MONTH9 NUMBER(1,0) not null,
	ZWRL_TRANSFER_MONTH10 NUMBER(1,0) not null,
	ZWRL_TRANSFER_MONTH11 NUMBER(1,0) not null,
	ZWRL_TRANSFER_MONTH12 NUMBER(1,0) not null, constraint ZWRL_PK primary key (ZWRL_ID) using index tablespace v8index  ) tablespace v8conf ; 

create sequence seq_ZWRL increment by 1 start with 1000 nomaxvalue nocycle nocache noorder;

ALTER TABLE XCMS ADD ( XCMS_AUTOMERGEERRORID NUMBER(1) NULL  );

create table YTRA (
	YTRA_ID NUMBER(30,0) not null,
	YTRA_YRES_ID NUMBER(30,0) not null,
	YTRA_ZTRA_ID NUMBER(30,0) not null,
	YTRA_ZFAC_ID NUMBER(30,0) not null,
	YTRA_TIMESTAMP DATE not null, constraint YTRA_PK primary key (YTRA_ID) using index tablespace v8index  ) tablespace v8main ; 

create sequence seq_YTRA increment by 1 start with 1000 nomaxvalue nocycle nocache noorder;

create table ZWIT (
	ZWIT_ID NUMBER(30,0) not null,
	ZWIT_TYPE NUMBER(2,0) not null,
	ZWIT_SHORTDESC VARCHAR(5) not null,
	ZWIT_LONGDESC VARCHAR2(30) not null,
	ZWIT_WCOL_ID NUMBER(30,0) null, constraint ZWIT_PK primary key (ZWIT_ID) using index tablespace v8index  ) tablespace v8conf ; 

create sequence seq_ZWIT increment by 1 start with 1000 nomaxvalue nocycle nocache noorder;

insert into zwit values (1, 0, 'REG', 'Regular', null);

insert into zwit values (2, 1, 'REB', 'Personal Rebate', null);

insert into zwit values (3, 2, 'MEA', 'Personal Meal', null);

insert into zwit values (4, 3, 'NOR', 'Personal no Rebate', null);

ALTER TABLE ZWIN ADD ( ZWIN_ZWIT_ID NUMBER(1) NULL  );

update zwin set zwin_zwit_id = 1 where zwin_zwit_id is null;

ALTER TABLE ZWIN MODIFY ( ZWIN_ZWIT_ID NOT NULL  );

ALTER TABLE ZFAG ADD ( ZFAG_AUTOWINDOWS NUMBER(1) NULL  );

ALTER TABLE ZWIN ADD ( ZWIN_BALANCEBEFORECLOSE NUMBER(30,4) NULL  );

ALTER TABLE ZINV ADD ( ZINV_FISCALNUMBER VARCHAR2(30) NULL  );

ALTER TABLE XCCS MODIFY ( XCCS_NUMBER VARCHAR(60)  );

ALTER TABLE YCAD ADD ( YCAD_DEFAULT NUMBER(1) NULL  );
