--UPDATE FROM 8.6.0.1 TO 8.6.0.2


DROP TABLE VERSION_8_6_0_1;



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

ALTER TABLE XADR ADD ( XADR_VERIFIED NUMBER(1) NULL  );

create table YRKR (
	YRKR_ID NUMBER(30,0) not null,
	YRKR_XPDA_ID NUMBER(30,0) not null,
	YRKR_YRMS_ID NUMBER(30,0) not null, constraint YRKR_PK primary key (YRKR_ID) using index tablespace v8index  ) tablespace v8conf ; 

CREATE SEQUENCE SEQ_YRKR INCREMENT BY 1 START WITH 1000 NOMAXVALUE NOCYCLE NOCACHE NOORDER;

UPDATE ZPOS SET ZPOS.ZPOS_NOREPRINT=0;

UPDATE zpos SET zpos_noreprint = 1
 WHERE (SELECT MAX (zpil_zinv_id)
          FROM zpil, zinv
          WHERE zpil_zpos_id = zpos_id
          AND zpil_zinv_id = zinv_id
          AND NVL (zinv_void_zinv_id, 0) = 0) >
          NVL ((SELECT MAX (zinv_id)
                 FROM zpil, zinv
                 WHERE zpil_zpos_id = zpos_id
                 AND zpil_zinv_id = zinv_id
                 AND zinv_void_zinv_id <> 0),0)
 AND (SELECT wuss.wuss_value FROM wuss 
 WHERE wuss.wuss_name LIKE 'Noreprint') = 1;

ALTER TABLE WACT ADD ( WACT_GLOBALID NUMBER(30) NULL  );

UPDATE YEMD SET YEMD_ZDCO_ID=(SELECT YFCA_ZDCO_ID FROM YFCA WHERE YFCA_ID=YEMD_YFCA_ID)WHERE NVL(YEMD_YFCA_ID,0)>=1;

ALTER TABLE YPAC ADD ( YPAC_PERCENTAGE NUMBER(1) NULL  );

ALTER TABLE YPAC ADD ( YPAC_MANUALPRICE NUMBER(1) NULL  );

ALTER TABLE YPAC ADD ( YPAC_PERCTOBASE NUMBER(1) NULL  );

ALTER TABLE YPAC ADD ( YPAC_FIXTOBASE NUMBER(1) NULL  );

ALTER TABLE YPAC ADD ( YPAC_DISCTOBASE NUMBER(1) NULL  );

ALTER TABLE YPRR ADD ( YPRR_FIXSTARTDATE NUMBER(1) NULL  );

ALTER TABLE XCOU ADD ( XCOU_DOMESTIC NUMBER(1) NULL  );

ALTER TABLE XCOU ADD ( XCOU_TOURIST_ZINN_ID NUMBER(30) NULL  );

create table WRPE (
	WRPE_ID NUMBER(30,0) not null,
	WRPE_YRES_ID NUMBER(30,0) not null,
	WRPE_XCMS_ID NUMBER(30,0) not null,
	WRPE_POLICENUMBER NUMBER(30,0) null,
	WRPE_TOURISTNUMBER NUMBER(30,0) null,
	WRPE_TIMESTAMP DATE not null,
	WRPE_HOTELDATE DATE not null,
	WRPE_CICO NUMBER(1,0) not null,
	WRPE_DEPARTURE DATE null, constraint WRPE_PK primary key (WRPE_ID) using index tablespace v8index  ) tablespace v8main ; 

CREATE SEQUENCE SEQ_WRPE INCREMENT BY 1 START WITH 1000 NOMAXVALUE NOCYCLE NOCACHE NOORDER;

ALTER TABLE WLAF ADD ( WLAF_RESOLVEDATE DATE NULL  );

ALTER TABLE WLAF ADD ( WLAF_RESOLVED_USER_XCMS_ID NUMBER(30) NULL  );

ALTER TABLE WLAF ADD ( WLAF_YPUB_ID NUMBER(30) NULL  );

ALTER TABLE WLFA MODIFY ( WLFA_FREETEXT VARCHAR2(200)  );

ALTER TABLE WLAF ADD ( WLAF_PICTURE_FORMAT NUMBER(1) NULL  );

ALTER TABLE WLFC ADD ( WLFC_INACTIVE NUMBER(1) NULL  );

ALTER TABLE WLFG ADD ( WLFG_INACTIVE NUMBER(1) NULL  );

ALTER TABLE XPDC ADD ( XPDC_BORN_XCOU_ID NUMBER(30) NULL  );