--UPDATE FROM 8.9.2.2 TO 8.9.2.3


DROP TABLE VERSION_8_9_2_2;



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

ALTER TABLE MCNV ADD MCNV_PMS_PROF_ID Number(30);

COMMENT ON COLUMN MCNV.MCNV_PMS_PROF_ID IS 'we can link a profile of a specific type to a specifc code. i.e a source profile to a source code';

UPDATE YRES SET YRES_YACC_ID=NULL WHERE YRES_YACC_ID=-1;

ALTER TABLE YPRT ADD YPRT_INACTIVE NUMBER(1) DEFAULT 0 NOT NULL;

ALTER TABLE XPDC MODIFY XPDC_NAME VARCHAR2(70);

ALTER TABLE YCAT ADD YCAT_KEYIFC_ICFG_ID NUMBER(30);

ALTER TABLE ZFAG ADD ZFAG_KEYIFC_ICFG_ID NUMBER(30);

COMMENT ON COLUMN YCAT.YCAT_KEYIFC_ICFG_ID IS 'linked Key Interface';

COMMENT ON COLUMN ZFAG.ZFAG_KEYIFC_ICFG_ID IS 'linked Key Interface';

UPDATE YCAT SET YCAT_KEYIFC_ICFG_ID = (SELECT ICFG_ID FROM ICFG WHERE ICFG_CMD_KEY <> 0 AND ICFG_ACTIVE = 1 AND ROWNUM= 1) WHERE NVL(YCAT_KEYIFC_ICFG_ID, 0) = 0;

UPDATE ZFAG SET ZFAG_KEYIFC_ICFG_ID = (SELECT ICFG_ID FROM ICFG WHERE ICFG_CMD_KEY <> 0 AND ICFG_ACTIVE = 1 AND ROWNUM= 1) WHERE ZFAG_SEND_IFC > 0 AND NVL(ZFAG_KEYIFC_ICFG_ID, 0) = 0;

UPDATE XPDA SET XPDA_ICFG_ID = (SELECT ICFG_ID FROM ICFG WHERE  ICFG_CMD_KEY <> 0 AND ICFG_ACTIVE = 1 AND ROWNUM= 1) WHERE XPDA_XPAC_ID = 25 AND NVL(XPDA_ICFG_ID, 0) = 0;

ALTER TABLE WDBG DROP COLUMN WDBG_BIGTEXT;

ALTER TABLE WDBG ADD WDBG_BIGTEXT CLOB;

ALTER TABLE WLOR ADD WLOR_COUP_ID NUMBER(30);

ALTER TABLE WLOR MODIFY WLOR_YRES_ID NULL;

INSERT INTO WLOR (WLOR_ID, WLOR_WLOP_ID, WLOR_COUP_ID) (SELECT SEQ_WLOR.NEXTVAL, COUP_WLOP_ID, COUP_ID FROM COUP CI WHERE COUP_WLOP_ID IS NOT NULL AND NOT EXISTS (SELECT 1 FROM WLOR WHERE WLOR_COUP_ID=CI.COUP_ID));

COMMENT ON COLUMN COUP.COUP_WLOP_ID IS 'Obsolete. Please use WLOR_COUP_ID' ;

ALTER TABLE W8HP ADD W8HP_QNR_SENDNOTIFICATION NUMBER(1) ;

ALTER TABLE W8HP ADD W8HP_QNR_WRPT_ID NUMBER(30);

ALTER TABLE W8HP ADD W8HP_QNR_EMAILID VARCHAR2(30);

ALTER TABLE W8HP ADD W8HP_QNR_SUBJECT_WRPT_ID NUMBER(30);

COMMENT ON COLUMN W8HP.W8HP_QNR_SENDNOTIFICATION IS 'Send email notification, when guest fills out questionnaire';

COMMENT ON COLUMN W8HP.W8HP_QNR_WRPT_ID IS 'Email Template id';

COMMENT ON COLUMN W8HP.W8HP_QNR_EMAILID IS 'Email id of the receiver';

COMMENT ON COLUMN W8HP.W8HP_QNR_WRPT_ID IS 'Email Subject Report id';

COMMENT ON COLUMN RRST.RRST_THRESHOLD IS 'Number of persons closed for web booking.';

ALTER TABLE YCDP ADD YCDP_ONLINEPAYMENT NUMBER(1);

COMMENT ON COLUMN YCDP.YCDP_ONLINEPAYMENT IS '1=collect online payment directly on homepage';

ALTER TABLE W8HP ADD W8HP_PAYDIRECT NUMBER(1);

COMMENT ON COLUMN W8HP.W8HP_PAYDIRECT IS 'if 1, it is not neccessary to enter a credit card and and the customer is routed to the defined pay system before reservation is confirmed.' ;

ALTER TABLE YCEV ADD YCEV_REQUESTCC NUMBER(1);

COMMENT ON COLUMN YCEV.YCEV_REQUESTCC IS '1=Reservations request cc in this timerange';

ALTER TABLE YCDP ADD YCDP_MANDATORYCC NUMBER(1);

COMMENT ON COLUMN YCDP.YCDP_MANDATORYCC IS '1=Reservations request cc in this timerange';

ALTER TABLE WATY ADD WATY_ISRESOLVEDNOTE NUMBER(1);

COMMENT ON COLUMN WATY.WATY_ISRESOLVEDNOTE IS 'Resolved Note';

ALTER TABLE WACT ADD WACT_RESOLVEDNOTE_WANT_ID NUMBER(30);

COMMENT ON COLUMN WACT.WACT_RESOLVEDNOTE_WANT_ID IS 'Resolved note id';  

ALTER TABLE WMSL ADD WMSL_DEFAULTFORSOLVE NUMBER(1);

COMMENT ON COLUMN WMSL.WMSL_DEFAULTFORSOLVE IS 'Default for solved'; 

ALTER TABLE WAGR ADD WAGR_NOTIFYHKSCREEN NUMBER(1) default 0;

COMMENT ON COLUMN WAGR.WAGR_NOTIFYHKSCREEN IS 'Notify in HK Screen'; 
