--UPDATE FROM 8.6.0.0 TO 8.6.0.1


DROP TABLE VERSION_8_6_0_0;



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


ALTER TABLE WPHS ADD ( WPHS_DBUSER VARCHAR(30) NULL  );

ALTER TABLE XCNO ADD ( XCNO_NOTESVARCHAR VARCHAR2(2000) NULL  );

ALTER TABLE WEAS ADD ( WEAS_ROLE NUMBER(1) NULL  );

ALTER TABLE XCMS ADD ( XCMS_MERGEDTO_XCMS_ID NUMBER(30) NULL  );

ALTER TABLE XCMS ADD ( XCMS_MERGETIME DATE NULL  );

ALTER TABLE YEBR MODIFY ( YEBR_ZDCO_ID NULL  );

ALTER TABLE YCIT MODIFY ( YCIT_YFCA_ID NULL  );

ALTER TABLE YCIT MODIFY ( YCIT_ZDCO_ID NULL  );

ALTER TABLE YRMS ADD ( YRMS_L_STATUS DATE NULL  );

ALTER TABLE YRMS ADD ( YRMS_HSK_NOOFPERSONS Number(30) NULL  );

ALTER TABLE SMAN ADD ( SMAN_REMOTE NUMBER(1) NULL  );

ALTER TABLE SRPD ADD ( SRPD_ZDCO_LONGDESC VARCHAR2(30) NULL  );

ALTER TABLE SRPD ADD ( SRPD_ZDCO_NUMERICDESC NUMBER(5) NULL  );

ALTER TABLE SRPD ADD ( SRPD_ZDCG_LONGDESC VARCHAR2(30) NULL  );

ALTER TABLE SRPD ADD ( SRPD_ZDCO_CDT NUMBER(1) NULL  );


UPDATE SMAN SET SMAN_REMOTE=0;

/*
For Hotel Connector Master Hotels:
This SQL works only if primary hotel is marked in config screen in master hotel.
But that is possible only after update is performed.
So the first time update script runs during the update procedure, this will have no effect and you 
need to mark primary hotel in WPHS in V8 config screen and then v8 will run this. So you need this 
only if you experience wrong SMAN_REMOTE values.
At the same time V8 will also update SMAN_WPHS_ID, if it is null.
*/

UPDATE SMAN SET SMAN_REMOTE=1
WHERE SMAN_WPHS_ID=(
   SELECT WPHS_ID  
   FROM WPHS 
   WHERE WPHS_ID=(SELECT WUSS_VALUE FROM WUSS WHERE WUSS_NAME='PrimaryPartnerHotel')
)  
AND 1=(SELECT WUSS_VALUE FROM WUSS WHERE WUSS_NAME='ThisHotelIsMaster');


DROP VIEW V8_IFC_GETBILLITEM;

DROP INDEX WRTR_COMPOSED;

DROP INDEX WFTR_COMPOSED;

DROP INDEX WRTR_STRING;
