/************************************************************************************************************************
*
*
*  Date: March 28, 2012  16:12:40
*
*  This upgrade script was automatically generated by DBDiff for Oracle (www.dbdiff.com)
*
*  SOURCE DATABASE:  VERSION_8_9_2_0@V8TEST2
*  TARGET DATABASE:  VERSION_8_9_0_0@V8TEST2
*
*  This script should be executed as VERSION_8_9_0_0 in database VERSION_8_9_0_0@V8TEST2 except where otherwise noted.
*
*  IMPORTANT:  As with any script, you should always perform a sanity check before executing it in your target database.
*
*
************************************************************************************************************************/




/************************************************************************************************************************
*
*  sequencess
*
*  The following statements will upgrade the sequences
*
************************************************************************************************************************/

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

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

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

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

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

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

CREATE SEQUENCE SEQ_YHFS INCREMENT BY 1 START WITH 1000 NOMAXVALUE MINVALUE 1 NOCYCLE NOCACHE NOORDER;
  
CREATE SEQUENCE SEQ_YRDE INCREMENT BY 1 START WITH 1000 NOMAXVALUE MINVALUE 1 NOCYCLE NOCACHE NOORDER;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


/************************************************************************************************************************
*
*  tables
*
*  942 tables were found in VERSION_8_9_2_0@V8TEST2
*  928 tables were found in VERSION_8_9_0_0@V8TEST2
*
************************************************************************************************************************/




/************************************************************************************************************************
*
*  The following statements will drop tables that DO NOT exist in VERSION_8_9_2_0@V8TEST2
*
************************************************************************************************************************/


DROP TABLE VERSION_8_9_0_0;


/************************************************************************************************************************
*
*  The following statements will create tables that DO NOT exist in VERSION_8_9_0_0@V8TEST2
*
************************************************************************************************************************/


/*  MCDE  */
CREATE TABLE MCDE (
	 MCDE_ID	NUMBER(30)	NOT NULL
	,MCDE_WPHS_ID	NUMBER(30)	NOT NULL
	,MCDE_TABLENAME	CHAR(4)	NOT NULL
	,MCDE_IDINMIRROR	NUMBER(30)	NOT NULL
	,MCDE_SHORTDESC	VARCHAR2(10)	NOT NULL
	,MCDE_LONGDESC	VARCHAR2(60)	NOT NULL
	,MCDE_DISPLORDER	NUMBER(5)	    NULL
	,MCDE_INACTIVE	NUMBER(1)	NOT NULL
	,MCDE_COMMENT	VARCHAR2(200)	    NULL
	,MCDE_OBSOLETE	NUMBER(1)	    NULL
)
PCTFREE  10
PCTUSED  40
INITRANS 1
MAXTRANS 255
TABLESPACE V8CONF
    STORAGE (
	INITIAL 64K
	NEXT 64K
	MINEXTENTS 1
	MAXEXTENTS 2147483645
	PCTINCREASE 50
	FREELISTS 1 FREELIST GROUPS 1
        )
;

ALTER TABLE MCDE ADD (
	CONSTRAINT MCDE_PK
	PRIMARY KEY
	            (
	             MCDE_ID
	            )
	USING INDEX
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
)
;
ALTER TABLE MCDE ADD (
	CONSTRAINT MCDE_ITEMUNIQUE
	UNIQUE
	       (
	        MCDE_WPHS_ID
	       ,MCDE_TABLENAME
	       ,MCDE_IDINMIRROR
	       )
	USING INDEX
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
)
;

/*  MYCAT  */
CREATE TABLE MYCAT (
	 MYCAT_ID	NUMBER(30)	NOT NULL
	,MYCAT_WPHS_ID	NUMBER(30)	NOT NULL
	,MYCAT_IDINMIRROR	NUMBER(30)	NOT NULL
	,MYCAT_SHORTDESC	VARCHAR2(10)	NOT NULL
	,MYCAT_LONGDESC	VARCHAR2(30)	NOT NULL
	,MYCAT_DISPLORDER	NUMBER(3)	    NULL
	,MYCAT_DISABLED	NUMBER(1)	    NULL
	,MYCAT_OBSOLETE	NUMBER(1)	    NULL
	,MYCAT_SUITE	NUMBER(1)	    NULL
	,MYCAT_DONTSELLALONE	NUMBER(1)	    NULL
	,MYCAT_MAXNOOFPERSONS	NUMBER(3)	    NULL
)
PCTFREE  10
PCTUSED  40
INITRANS 1
MAXTRANS 255
TABLESPACE V8CONF
    STORAGE (
	INITIAL 64K
	NEXT 64K
	MINEXTENTS 1
	MAXEXTENTS 2147483645
	PCTINCREASE 50
	FREELISTS 1 FREELIST GROUPS 1
        )
;

ALTER TABLE MYCAT ADD (
	CONSTRAINT MYCAT_PK
	PRIMARY KEY
	            (
	             MYCAT_ID
	            )
	USING INDEX
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
)
;
ALTER TABLE MYCAT ADD (
	CONSTRAINT MYCAT_ITEMUNIQUE
	UNIQUE
	       (
	        MYCAT_WPHS_ID
	       ,MYCAT_IDINMIRROR
	       )
	USING INDEX
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
)
;

/*  MYRCH  */
CREATE TABLE MYRCH (
	 MYRCH_ID	NUMBER(30)	NOT NULL
	,MYRCH_WPHS_ID	NUMBER(30)	NOT NULL
	,MYRCH_IDINMIRROR	NUMBER(30)	NOT NULL
	,MYRCH_SHORTDESC	VARCHAR2(10)	NOT NULL
	,MYRCH_LONGDESC	VARCHAR2(30)	NOT NULL
	,MYRCH_DISPLORDER	NUMBER(3)	    NULL
	,MYRCH_INACTIVE	NUMBER(1)	    NULL
	,MYRCH_OBSOLETE	NUMBER(1)	    NULL
)
PCTFREE  10
PCTUSED  40
INITRANS 1
MAXTRANS 255
TABLESPACE V8CONF
    STORAGE (
	INITIAL 64K
	NEXT 64K
	MINEXTENTS 1
	MAXEXTENTS 2147483645
	PCTINCREASE 50
	FREELISTS 1 FREELIST GROUPS 1
        )
;

ALTER TABLE MYRCH ADD (
	CONSTRAINT MYRCH_PK
	PRIMARY KEY
	            (
	             MYRCH_ID
	            )
	USING INDEX
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
)
;
ALTER TABLE MYRCH ADD (
	CONSTRAINT MYRCH_ITEMUNIQUE
	UNIQUE
	       (
	        MYRCH_WPHS_ID
	       ,MYRCH_IDINMIRROR
	       )
	USING INDEX
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
)
;

/*  SPRS  */
CREATE TABLE SPRS (
	 SPRS_XCMS_NAME1	VARCHAR2(35)	NOT NULL
	,SPRS_NAMECOUNT	NUMBER(10)	NOT NULL
)
PCTFREE  10
PCTUSED  40
INITRANS 1
MAXTRANS 255
TABLESPACE V8MAIN
    STORAGE (
	INITIAL 64K
	NEXT 64K
	MINEXTENTS 1
	MAXEXTENTS 2147483645
	PCTINCREASE 50
	FREELISTS 1 FREELIST GROUPS 1
        )
;

ALTER TABLE SPRS ADD (
	CONSTRAINT SPRS_PK
	PRIMARY KEY
	            (
	             SPRS_XCMS_NAME1
	            )
	USING INDEX
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
)
;

/*  STAB  */
CREATE TABLE STAB (
	 STAB_SNAPSHOTTIME	DATE	    NULL
	,STAB_TABLE_NAME	VARCHAR2(40)	    NULL
	,STAB_ROW_NUMBER	NUMBER(30)	    NULL
	,STAB_MAX_ID	NUMBER(30)	    NULL
	,STAB_BATCH_NUMBER	NUMBER(30)	    NULL
)
PCTFREE  10
PCTUSED  40
INITRANS 1
MAXTRANS 255
TABLESPACE V8MAIN
    STORAGE (
	INITIAL 64K
	NEXT 64K
	MINEXTENTS 1
	MAXEXTENTS 2147483645
	PCTINCREASE 50
	FREELISTS 1 FREELIST GROUPS 1
        )
;


/*  VERSION_8_9_2_0  */
CREATE TABLE VERSION_8_9_2_0 (
	 DUMMY	NUMBER	    NULL
)
PCTFREE  10
PCTUSED  40
INITRANS 1
MAXTRANS 255
TABLESPACE V8MAIN
    STORAGE (
	INITIAL 64K
	NEXT 64K
	MINEXTENTS 1
	MAXEXTENTS 2147483645
	PCTINCREASE 50
	FREELISTS 1 FREELIST GROUPS 1
        )
;


/*  WORJ  */
CREATE TABLE WORJ (
	 WORJ_ID	NUMBER(30)	NOT NULL
	,WORJ_SHORTDESCRIPTION	VARCHAR2(60)	    NULL
	,WORJ_LONGDESCRIPTION	VARCHAR2(200)	    NULL
	,WORJ_DISPLAYORDER	NUMBER(4)	    NULL
	,WORJ_INACTIVE	NUMBER(1)	    NULL
	,WORJ_ROLE	NUMBER(1)	    NULL
	,WORJ_DEFAULT	NUMBER(1)	    NULL
)
PCTFREE  10
PCTUSED  40
INITRANS 1
MAXTRANS 255
TABLESPACE V8CONF
    STORAGE (
	INITIAL 64K
	NEXT 64K
	MINEXTENTS 1
	MAXEXTENTS 2147483645
	PCTINCREASE 50
	FREELISTS 1 FREELIST GROUPS 1
        )
;

ALTER TABLE WORJ ADD (
	CONSTRAINT WORJ_PK
	PRIMARY KEY
	            (
	             WORJ_ID
	            )
	USING INDEX
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
)
;

/*  WPHL  */
CREATE TABLE WPHL (
	 WPHL_ID	NUMBER(30)	NOT NULL
	,WPHL_WPHS_ID	NUMBER(30)	NOT NULL
	,WPHL_LINK	VARCHAR2(30)	NOT NULL
	,HOTEL_ID	NUMBER(30)	NOT NULL
)
PCTFREE  10
PCTUSED  40
INITRANS 1
MAXTRANS 255
TABLESPACE V8MAIN
    STORAGE (
	INITIAL 64K
	NEXT 64K
	MINEXTENTS 1
	MAXEXTENTS 2147483645
	PCTINCREASE 50
	FREELISTS 1 FREELIST GROUPS 1
        )
;

ALTER TABLE WPHL ADD (
	CONSTRAINT WPHL_PK
	PRIMARY KEY
	            (
	             WPHL_ID
	            ,HOTEL_ID
	            )
	USING INDEX
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
)
;

/*  WSFH  */
CREATE TABLE WSFH (
	 WSFH_ID	NUMBER(30)	NOT NULL
	,WSFH_DESCRIPTION	VARCHAR2(50)	NOT NULL
	,WSFH_DATA	LONG RAW	    NULL
	,WSFH_ISPROCESSED	NUMBER(1)	NOT NULL
	,WSFH_CREATEDON	DATE	NOT NULL
	,WSFH_PROCESSEDON	DATE	    NULL
	,WSCH_ATTACHED_XCMS_ID	NUMBER(30)	    NULL
	,WSFH_CREATEDBY_XCMS_ID	NUMBER(30)	NOT NULL
	,WSFH_PROCESSEDBY_XCMS_ID	NUMBER(30)	    NULL
	,WSFH_FILENAME	VARCHAR2(150)	NOT NULL
	,WSFH_FILENAME2	VARCHAR2(150)	    NULL
	,WSFH_FACEFILENAME	VARCHAR2(150)	    NULL
	,WSFH_LINKED_YRES_ID	NUMBER(30)	    NULL
	,WSFH_LINKED_XCMS_ID	NUMBER(30)	    NULL
)
PCTFREE  10
PCTUSED  40
INITRANS 1
MAXTRANS 255
TABLESPACE V8LARGE
    STORAGE (
	INITIAL 64K
	NEXT 64K
	MINEXTENTS 1
	MAXEXTENTS 2147483645
	PCTINCREASE 50
	FREELISTS 1 FREELIST GROUPS 1
        )
;

ALTER TABLE WSFH ADD (
	CONSTRAINT WSFH_PK
	PRIMARY KEY
	            (
	             WSFH_ID
	            )
	USING INDEX
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
)
;

/*  YCER  */
CREATE TABLE YCER (
	 YCER_ID	NUMBER(30)	NOT NULL
	,YCER_SHORTDESC	VARCHAR2(3)	NOT NULL
	,YCER_LONGDESC	VARCHAR2(60)	NOT NULL
	,YCER_DISPLORDER	NUMBER(3)	    NULL
	,YCER_WCOL_ID	NUMBER(30)	    NULL
	,YCER_AVLINFLUENCELEVEL	NUMBER(1)	    NULL
	,YCER_YCET_ID	NUMBER(30)	    NULL
)
PCTFREE  10
PCTUSED  40
INITRANS 1
MAXTRANS 255
TABLESPACE V8CONF
    STORAGE (
	INITIAL 64K
	NEXT 64K
	MINEXTENTS 1
	MAXEXTENTS 2147483645
	PCTINCREASE 50
	FREELISTS 1 FREELIST GROUPS 1
        )
;

ALTER TABLE YCER ADD (
	CONSTRAINT YCER_PK
	PRIMARY KEY
	            (
	             YCER_ID
	            )
	USING INDEX
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
)
;

/*  YCIL  */
CREATE TABLE YCIL (
	 YCIL_ID	NUMBER(30)	NOT NULL
	,YCIL_START	DATE	NOT NULL
	,YCIL_KEEPALIVE	DATE	NOT NULL
	,YCIL_FINISH	DATE	    NULL
	,YCIL_APP	VARCHAR2(20)	NOT NULL
	,YCIL_WPCA_ID	NUMBER(30)	    NULL
	,YCIL_TABLENAME	VARCHAR2(40)	NOT NULL
	,YCIL_LOG	VARCHAR2(2000)	    NULL
	,YCIL_ITEMCOUNT	NUMBER(6)	    NULL
	,YCIL_ERRORCOUNT	NUMBER(6)	    NULL
)
PCTFREE  10
PCTUSED  40
INITRANS 1
MAXTRANS 255
TABLESPACE V8MAIN
    STORAGE (
	INITIAL 64K
	NEXT 64K
	MINEXTENTS 1
	MAXEXTENTS 2147483645
	PCTINCREASE 50
	FREELISTS 1 FREELIST GROUPS 1
        )
;

ALTER TABLE YCIL ADD (
	CONSTRAINT YCIL_PK
	PRIMARY KEY
	            (
	             YCIL_ID
	            )
	USING INDEX
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
)
;

/*  YRMR  */
CREATE TABLE YRMR (
	 YRMR_ID	NUMBER(30)	NOT NULL
	,YRMR_REASON	VARCHAR2(200)	NOT NULL
	,YRMR_DISPLORDER	NUMBER(3)	    NULL
)
PCTFREE  10
PCTUSED  40
INITRANS 1
MAXTRANS 255
TABLESPACE V8MAIN
    STORAGE (
	INITIAL 64K
	NEXT 64K
	MINEXTENTS 1
	MAXEXTENTS 2147483645
	PCTINCREASE 50
	FREELISTS 1 FREELIST GROUPS 1
        )
;

ALTER TABLE YRMR ADD (
	CONSTRAINT YRMR_PK
	PRIMARY KEY
	            (
	             YRMR_ID
	            )
	USING INDEX
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
)
;
ALTER TABLE YRMR ADD (
	CONSTRAINT YRMR_REASON
	UNIQUE
	       (
	        YRMR_REASON
	       )
	USING INDEX
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
)
;

/*  YRPH  */
CREATE TABLE YRPH (
	 YRPH_ID	NUMBER(30)	NOT NULL
	,YRPH_YRCH_ID	NUMBER(30)	NOT NULL
	,YRPH_YPAC_ID	NUMBER(30)	NOT NULL
	,YRPH_TYPE	NUMBER(1)	    NULL
)
PCTFREE  10
PCTUSED  40
INITRANS 1
MAXTRANS 255
TABLESPACE V8MAIN
    STORAGE (
	INITIAL 64K
	NEXT 64K
	MINEXTENTS 1
	MAXEXTENTS 2147483645
	PCTINCREASE 50
	FREELISTS 1 FREELIST GROUPS 1
        )
;

ALTER TABLE YRPH ADD (
	CONSTRAINT YRPH_PK
	PRIMARY KEY
	            (
	             YRPH_ID
	            )
	USING INDEX
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
)
;

/*  YSLM  */
CREATE TABLE YSLM (
	 YSLM_ID	NUMBER(30)	NOT NULL
	,YSLM_DATE	DATE	NOT NULL
	,YSLM_TYPE	NUMBER(1)	NOT NULL
	,YSLM_RECID	NUMBER(30)	NOT NULL
	,YSLM_WEBLIMIT	NUMBER(30)	    NULL
	,YSLM_GENERALLIMIT	NUMBER(5)	    NULL
)
PCTFREE  10
PCTUSED  40
INITRANS 1
MAXTRANS 255
TABLESPACE V8MAIN
    STORAGE (
	INITIAL 64K
	NEXT 64K
	MINEXTENTS 1
	MAXEXTENTS 2147483645
	PCTINCREASE 50
	FREELISTS 1 FREELIST GROUPS 1
        )
;

ALTER TABLE YSLM ADD (
	CONSTRAINT YSLM_PK
	PRIMARY KEY
	            (
	             YSLM_ID
	            )
	USING INDEX
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
)
;

/*  ZELL  */
CREATE TABLE ZELL (
	 ZELL_ID	NUMBER(30)	NOT NULL
	,ZELL_YRES_ID	NUMBER(30)	    NULL
	,ZELL_ZPOS_ID	NUMBER(30)	    NULL
	,ZELL_TYPE	NUMBER(1) DEFAULT 0 	NOT NULL
	,ZELL_POSTTIME	DATE	    NULL
)
PCTFREE  10
PCTUSED  40
INITRANS 1
MAXTRANS 255
TABLESPACE V8MAIN
    STORAGE (
	INITIAL 64K
	NEXT 64K
	MINEXTENTS 1
	MAXEXTENTS 2147483645
	PCTINCREASE 50
	FREELISTS 1 FREELIST GROUPS 1
        )
;

ALTER TABLE ZELL ADD (
	CONSTRAINT ZELL_PK
	PRIMARY KEY
	            (
	             ZELL_ID
	            )
	USING INDEX
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
)
;

/*  YMCF  */
CREATE TABLE YMCF (
   YMCF_ID NUMBER(30) NOT NULL
  ,YMCF_YRPL_ID NUMBER(30) NOT NULL
  ,CONSTRAINT YMCF_PK PRIMARY KEY (YMCF_ID) USING INDEX TABLESPACE V8INDEX
) TABLESPACE V8MAIN;

CREATE UNIQUE INDEX YMCF_YRPL_ID ON YMCF (YMCF_YRPL_ID) TABLESPACE V8INDEX;

/*  WSKL  */
CREATE TABLE WSKL (
 WSKL_ID NUMBER(30) NOT NULL
,WSKL_XCMS_ID NUMBER(30) NOT NULL
,WSKL_WATY_ID NUMBER(30) NOT NULL
,WSKL_DISPLORDER NUMBER(4)
,CONSTRAINT WSKL_PK PRIMARY KEY (WSKL_ID) USING INDEX TABLESPACE V8INDEX) TABLESPACE V8CONF;

/*  WMSL  */
CREATE TABLE WMSL (
 WMSL_ID NUMBER(30) NOT NULL
,WMSL_SHORTDESC VARCHAR2(3) NOT NULL
,WMSL_LONGDESC VARCHAR2(30) NOT NULL
,WMSL_DISPLORDER NUMBER(3,0) NOT NULL
,WMSL_WEBENABLED NUMBER (1) NOT NULL
,WMSL_INACTIVE NUMBER(1) NOT NULL
,CONSTRAINT WMSL_PK PRIMARY KEY (WMSL_ID) USING INDEX TABLESPACE V8INDEX) TABLESPACE V8CONF;

/*  WINT  */
CREATE TABLE WINT (
  WINT_ID NUMBER(30) NOT NULL
  ,WINT_INTERVAL NUMBER(3) NOT NULL
  ,WINT_INTERVALTYPE NUMBER(1) NOT NULL
  ,WINT_SNAP NUMBER(1) NOT NULL
  ,CONSTRAINT WINT_PK PRIMARY KEY (WINT_ID) USING INDEX TABLESPACE V8INDEX) TABLESPACE V8MAIN;

/*  MCRT  */  
CREATE TABLE MCRT
(
  MCRT_ID               NUMBER(30)              NOT NULL,
  MCRT_MCNV_ID          NUMBER(30)              NOT NULL,
  MCRT_CRS_CODE         VARCHAR2(30),
  MCRT_MIN_NUM_PERSONS  NUMBER(2),
  MCRT_MAX_NUM_PERSONS  NUMBER(2),
  CONSTRAINT MCRT_PK PRIMARY KEY (MCRT_ID) USING INDEX TABLESPACE V8INDEX) TABLESPACE V8CONF;

/*  XAAL  */    
CREATE TABLE XAAL (
  XAAL_ID NUMBER(30) NOT NULL
  ,XAAL_XADR_ID NUMBER(30) NOT NULL
  ,XAAL_XPDA_ID NUMBER(30) NOT NULL
  ,XAAL_XPAC_ID NUMBER(30) NOT NULL
  ,CONSTRAINT XAAL_PK PRIMARY KEY (XAAL_ID) USING INDEX TABLESPACE V8INDEX) TABLESPACE V8MAIN;

/*  WCSP  */    
CREATE TABLE WCSP (
   WCSP_ID NUMBER(30) NOT NULL
  ,WCSP_ROLE NUMBER(2) NOT NULL
  ,WCSP_SENDING NUMBER(1) NOT NULL
  ,WCSP_LETTER_XADR_ID NUMBER(30)
  ,WCSP_EMAIL_XCOM_ID NUMBER(30)
  ,WCSP_XMNR_ID NUMBER(30)
  ,CONSTRAINT WCSP_PK PRIMARY KEY (WCSP_ID) USING INDEX TABLESPACE V8INDEX) TABLESPACE V8MAIN;

/*  YHFS  */    
CREATE TABLE YHFS (
    YHFS_ID NUMBER(30) NOT NULL
   ,YHFS_NUMBEROFATTENDANTS NUMBER(3) 
   ,YHFS_DEFAULTCREDITS NUMBER(3) 
   ,YHFS_ALLOWAUTOEXTEND NUMBER(1)
   ,YHFS_AUTOREDUCE NUMBER(1)
   ,YHFS_AUTOMAIDNAME VARCHAR2(50 CHAR)
   ,YHFS_USEDEFINED NUMBER(1)
   ,YHFS_USEATTENDANTCONFIG NUMBER(1)
   ,YHFS_ATTENDANTTYPE NUMBER(30)
   ,YHFS_METHOD NUMBER(1) DEFAULT 0 NOT NULL
   ,YHFS_INCLUDEPUBLICPLACES NUMBER(1)
   ,YHFS_INCLUDEFUNCTIONSPACES NUMBER(1)
   ,YHFS_INCLUDECLEANROOMS NUMBER(1)
   ,YHFS_INCLUDEONLYFORARRIVALS NUMBER(1)
   ,YHFS_INCLUDEOOOROOMS NUMBER(1)
   ,YHFS_LISTCLEANASNOTASSIGNED NUMBER(1)
   ,CONSTRAINT YHFS_PK PRIMARY KEY (YHFS_ID) USING INDEX TABLESPACE V8INDEX) TABLESPACE V8CONF;

/*  YRDE  */   
CREATE TABLE YRDE (
  YRDE_ID NUMBER(30) NOT NULL
  ,YRDE_YRDD_ID NUMBER(30) NOT NULL
  ,YRDE_STARTDATE DATE 
  ,YRDE_ENDDATE DATE 
  ,CONSTRAINT YRDE_PK PRIMARY KEY (YRDE_ID) USING INDEX TABLESPACE V8INDEX) TABLESPACE V8CONF;

/*  WSET  */   
CREATE TABLE WSET(
WSET_ID NUMBER(30) NOT NULL
,WSET_NAME VARCHAR2(60) 
,WSET_SERIALNUMBER VARCHAR2(20) 
,WSET_PORT NUMBER(1)
,WSET_PARITY NUMBER(1)
,WSET_BAUDRATE NUMBER(30)
,WSET_TYPE VARCHAR2(1)
,WSET_TIMEOUT NUMBER(4)
,WSET_MINDELAY NUMBER(4)
,WSET_MAXDELAY NUMBER(4)
,WSET_SWVERSION VARCHAR2(10)
,CONSTRAINT WSET_PK PRIMARY KEY (WSET_ID) USING INDEX TABLESPACE V8INDEX) TABLESPACE V8CONF;

/*  CORD  */   
CREATE TABLE CORD
(
  CORD_ID                 NUMBER(30)            NOT NULL,
  CORD_ORDERNAME          VARCHAR2(100),  
  CORD_DESCRIPTION        VARCHAR2(4000),
  CORD_TEXT               VARCHAR2(1000),
  CORD_ISSUE              DATE,
  CORD_VALIDFROM          DATE,
  CORD_VALIDUNTIL         DATE,
  CORD_XCMS_ID            NUMBER(30),
  CORD_QUANTITY           NUMBER(30)          NOT NULL,
  CORD_CART_ID            NUMBER(30),
  CORD_ZFAC_ID            NUMBER(30),
  CORD_FINALIZED          NUMBER(1),
  CORD_DEDICATION         VARCHAR2(4000),
  CORD_CONSUMING_XCMS_ID  NUMBER(30),
  CORD_INTERNAL_INFO      VARCHAR2(1000),
  CORD_ORDER_REASON       VARCHAR2(100)
  ,CONSTRAINT CORD_PK PRIMARY KEY (CORD_ID) USING INDEX TABLESPACE V8INDEX) TABLESPACE V8MAIN;

/*  YBLS  */   
CREATE TABLE YBLS (
  YBLS_ID NUMBER(30) NOT NULL
  ,YBLS_YBLD_ID NUMBER(30) NOT NULL
  ,YBLS_OCCUPANCYSPLIT NUMBER(5) NOT NULL
  ,YBLS_ADULTNO NUMBER(5)
  ,CONSTRAINT YBLS_PK PRIMARY KEY (YBLS_ID) USING INDEX TABLESPACE V8INDEX) TABLESPACE V8MAIN;
  
/*  YBSS  */   
CREATE TABLE YBSS (
   YBSS_ID NUMBER(30)
  ,YBSS_YBLH_ID NUMBER(30)
  ,YBSS_YBLD_ID NUMBER(30)
  ,YBSS_YBLS_ID NUMBER(30)
  ,YBSS_YCAT_ID NUMBER(30) 
  ,YBSS_DATE DATE
  ,YBSS_ZDCO_ID NUMBER(30)
  ,YBSS_UNITPRICE NUMBER(30,4)
  ,YBSS_QUANTITY NUMBER(10)
  ,YBSS_TAXLINK_ID NUMBER(30)
  ,YBSS_INTERNALSPLIT_ID NUMBER(30)
  ,YBSS_DT NUMBER(1)  -- 1 = DEBIT     2 = TAX
  ,YBSS_TYPE NUMBER(1) --0=NORMAL POSTINGS 1=FIXED CHARGES(NOT USED FOR BLOCKS ONLY FOR YPOS) 2=PACKAGE RELATED POSTINGS
  ,YBSS_ADULTNO NUMBER(3)
  ,YBSS_OCCUPANCYSPLIT NUMBER(3)  
  ,CONSTRAINT YBSS_PK PRIMARY KEY (YBSS_ID) USING INDEX TABLESPACE V8INDEX) TABLESPACE V8MAIN;

  
/************************************************************************************************************************
*
*  The following statements will upgrade the COMMON tables
*
************************************************************************************************************************/

ALTER TABLE ZPOS ADD ZPOS_WPCA_ID NUMBER(30);

ALTER TABLE XCMM ADD XCMM_REPORT_GROUP NUMBER (1);

ALTER TABLE WMAI ADD WMAI_ERROR VARCHAR2(2000);

ALTER TABLE YBLH ADD YBLH_ADDTOMEALPLAN NUMBER(1) DEFAULT 1 NOT NULL;

ALTER TABLE YCEV ADD YCEV_LOCATIONID NUMBER(30);

ALTER TABLE YCEV ADD YCEV_LOCATIONTYPE NUMBER(1); 

ALTER TABLE YCEV ADD YCEV_TICKET_ZDCO_ID NUMBER(30);

ALTER TABLE YCEV ADD YCEV_DEFAULT_TICKETPRICE NUMBER(30, 4);

ALTER TABLE YCEV ADD YCEV_MAX_WEB_SELL NUMBER(5);

ALTER TABLE YCEV ADD YCEV_EST_ATTENDANCE NUMBER(5);

ALTER TABLE YCET ADD YCET_TICKET_ZDCO_ID NUMBER(30);

ALTER TABLE YCET ADD YCET_ADDATTENDEES NUMBER(1);

ALTER TABLE YCEP ADD YCEP_NOOFADULTS NUMBER(2);

ALTER TABLE QNRF ADD QNRF_YBOM_ID NUMBER(30);

ALTER TABLE WATY  ADD WATY_PRIORITY NUMBER(1) ;

ALTER TABLE WACT ADD WACT_WMSL_ID NUMBER(30);

ALTER TABLE WACT  ADD WACT_ESTIMATED_DURATION_MIN NUMBER(12) ;

ALTER TABLE WACT  ADD WACT_ACTUAL_DURATION_MIN NUMBER(12) ;

ALTER TABLE WATY  ADD WATY_ASKDURATION NUMBER(1) ;

ALTER TABLE WMSL ADD WMSL_FORRESOLVE NUMBER(1) ;

ALTER TABLE WATY  ADD WATY_DURATION_MIN NUMBER(8) ;

ALTER TABLE COUP MODIFY COUP_DESCRIPTION VARCHAR2(4000);

ALTER TABLE CART MODIFY CART_COUPONDESCR VARCHAR2(4000);

ALTER TABLE WPCA ADD WPCA_HASEIDREADER NUMBER(1);

ALTER TABLE MQU1 ADD MQU1_MMOD_ID NUMBER(30); 

ALTER TABLE MQU2 ADD MQU2_MMOD_ID NUMBER(30);

ALTER TABLE MQU3 ADD MQU3_MMOD_ID NUMBER(30);

ALTER TABLE MQU4 ADD MQU4_MMOD_ID NUMBER(30);

ALTER TABLE MMOD ADD MMOD_ERR_NOTIFY_EMAIL VARCHAR2(2000);

ALTER TABLE MCNV ADD MCNV_CRS_CATEGORY VARCHAR2(30);

ALTER TABLE WEDA MODIFY(WEDA_ROLE NUMBER(2));

ALTER TABLE XCEE MODIFY(XCEE_MODULE NUMBER(2));

ALTER TABLE WSCM MODIFY(WSCM_MODULE NUMBER(2));

ALTER TABLE WEDA ADD WEDA_WTXT_ID NUMBER(30);

ALTER TABLE XSCD ADD XSCD_ADDDEFAULTATTACHMENTS NUMBER(1);

ALTER TABLE YRCO ADD YRCO_RRES_ID NUMBER(30);

ALTER TABLE XPAC ADD XPAC_APPLRESOURCE NUMBER(1);

ALTER TABLE RRES ADD RRES_PRICE NUMBER(30,4);

ALTER TABLE XPAC ADD XPAC_ADDRIND NUMBER(1);

ALTER TABLE XPAC ADD XPAC_ADDRCOMP NUMBER(1);

ALTER TABLE YEBS ADD YEBS_DISPLORDER NUMBER(3);

ALTER TABLE YPUB ADD (YPUB_DEFAULTCREDITS NUMBER(3));

ALTER TABLE YFSC ADD (YFSC_DEFAULTCREDITS NUMBER(3), YFSC_DEPARTURECREDITS NUMBER(3), YFSC_CLEANCREDITS NUMBER(3));

ALTER TABLE YHRL ADD (YHRL_YPUB_ID NUMBER(30), YHRL_YFSC_ID NUMBER(30));

ALTER TABLE YPUB ADD (YPUB_COUNTINATTENDANTPLAN NUMBER(1));

ALTER TABLE XCTL MODIFY XCTL_XMNR_ID NULL;

ALTER TABLE YCMC ADD YCMC_FMGR_ID NUMBER(30);

ALTER TABLE YCMC ADD YCMC_ROLE NUMBER(2);

ALTER TABLE YOUT ADD YOUT_XADR_ID NUMBER(30,0);

ALTER TABLE YOUT ADD YOUT_ADVERTISEMENT1 VARCHAR2(120);

ALTER TABLE YOUT ADD YOUT_ADVERTISEMENT2 VARCHAR2(120);

ALTER TABLE YOUT ADD YOUT_ONECHECKPERTABLE NUMBER(1);

ALTER TABLE YOUT ADD YOUT_ASKCOURSEORDER NUMBER(1);

ALTER TABLE YOUT ADD YOUT_ROLE NUMBER(3);

ALTER TABLE YOUT ADD YOUT_RRST_ID NUMBER(30,0);

ALTER TABLE YRES ADD YRES_NO_EFT_AUTHORIZATION NUMBER(1);

ALTER TABLE ZWIN ADD ZWIN_NOBONUSPOINTS NUMBER(1) DEFAULT 0 NOT NULL;

ALTER TABLE QNRF ADD QNRF_FILLOUTDATE DATE;

ALTER TABLE ZWIN ADD ZWIN_NOBONUSPOINTS NUMBER(1) DEFAULT 0 NOT NULL;

ALTER TABLE WQNR ADD WQNR_COLUMNCOUNT NUMBER(3);

ALTER TABLE WQNL ADD WQNL_COLUMNCOUNT NUMBER(3);

ALTER TABLE SMAN ADD SMAN_ROOMS_OCC_E1P_D NUMBER(5);

ALTER TABLE SMAN ADD SMAN_ROOMS_OCC_E1P_M NUMBER(5);

ALTER TABLE SMAN ADD SMAN_ROOMS_OCC_E1P_Y NUMBER(7);

ALTER TABLE SMAN ADD SMAN_ROOMS_OCC_M1P_D NUMBER(5);

ALTER TABLE SMAN ADD SMAN_ROOMS_OCC_M1P_M NUMBER(5);

ALTER TABLE SMAN ADD SMAN_ROOMS_OCC_M1P_Y NUMBER(7);

ALTER TABLE YCMC ADD YCMC_FMGR_ID NUMBER(30);

ALTER TABLE YCMC ADD YCMC_ROLE NUMBER(2);

ALTER TABLE YOUT ADD YOUT_XADR_ID NUMBER(30,0);

ALTER TABLE YOUT ADD YOUT_ADVERTISEMENT1 VARCHAR2(120);

ALTER TABLE YOUT ADD YOUT_ADVERTISEMENT2 VARCHAR2(120);

ALTER TABLE YOUT ADD YOUT_ONECHECKPERTABLE NUMBER(1);

ALTER TABLE YOUT ADD YOUT_ASKCOURSEORDER NUMBER(1);

ALTER TABLE YOUT ADD YOUT_ROLE NUMBER(3);

ALTER TABLE YOUT ADD YOUT_RRST_ID NUMBER(30,0);

ALTER TABLE W8HP ADD W8HP_BOOKWITHOUTREGISTRATION NUMBER(1);

ALTER TABLE YHRI ADD YHRI_SOLD NUMBER (10);

ALTER TABLE XCMS ADD XCMS_BATCHID NUMBER(30);

ALTER TABLE ACMP ADD ACMP_NUMBER VARCHAR2(60);

ALTER TABLE WQUE ADD WQUE_QUESTIONKIND NUMBER(3);

ALTER TABLE YHRL ADD YHRL_YHFS_ID NUMBER(30);

ALTER TABLE WPCA ADD WPCA_REFRESHLEVEL NUMBER(3);

ALTER TABLE MWSV ADD MWSV_LASTREQUEST DATE;

ALTER TABLE MURL ADD MURL_LASTREQUEST DATE;

ALTER TABLE YEBS ADD YEBS_PRICE_NET NUMBER(30,4);

ALTER TABLE YEBS ADD YEBS_PRICE_VAT NUMBER(30,4);

ALTER TABLE YEBR ADD YEBR_PRICE_NET NUMBER(30,4);

ALTER TABLE YEBR ADD YEBR_PRICE_VAT NUMBER(30,4);

ALTER TABLE YMRD ADD YMRD_PRICE_NET NUMBER(30,4);

ALTER TABLE YMRD ADD YMRD_PRICE_VAT NUMBER(30,4);

ALTER TABLE YEMI ADD YEMI_PRICE_NET NUMBER(30,4);

ALTER TABLE YEMI ADD YEMI_PRICE_VAT NUMBER(30,4);

ALTER TABLE YBEF ADD YBEF_PRICE_NET NUMBER(30,4);

ALTER TABLE YBEF ADD YBEF_PRICE_VAT NUMBER(30,4);

ALTER TABLE MWSV MODIFY MWSV_LASTREQUEST TIMESTAMP(6);

ALTER TABLE MURL MODIFY MURL_LASTREQUEST TIMESTAMP(6);

ALTER TABLE XPHN ADD XPHN_WPCA_ID NUMBER(30);

ALTER TABLE XPHN ADD XPHN_XCMT_ID NUMBER(30);

ALTER TABLE YRDY ADD YRDY_YRDE_ID NUMBER(30);

ALTER TABLE WPCA ADD WPCA_WSET_ID NUMBER(30);

ALTER TABLE WPCA ADD WPCA_ETAX_REGISTERID VARCHAR2(16);

ALTER TABLE ZINV MODIFY ZINV_FISCALNUMBER VARCHAR2(100);

ALTER TABLE ZDCO ADD ZDCO_DISABLE_FISCALPRINTER NUMBER(1);

ALTER TABLE YPAC ADD YPAC_BOARDTYPE NUMBER(1) DEFAULT 0 NOT NULL;

ALTER TABLE COUP ADD COUP_CORD_ID NUMBER(30);

ALTER TABLE CORD ADD CORD_YRES_ID NUMBER(30);

ALTER TABLE CORD ADD CORD_AMOUNT NUMBER(30, 4);

ALTER TABLE ZINV ADD ZINV_CITYLEDGERNUMBER VARCHAR2(60 CHAR);

ALTER TABLE FPLI ADD ( FPLI_VALIDFROM DATE NULL  );

ALTER TABLE FPLI ADD ( FPLI_VALIDUNTIL DATE NULL  );

ALTER TABLE MCFG ADD ( MCFG_MASTER NUMBER(1) NULL  );

ALTER TABLE MMOD MODIFY ( MMOD_VENDOR_NO NUMBER(30) NULL  );

ALTER TABLE MMOD ADD ( MMOD_FTP_SSL_SESSION_RESUMP NUMBER(1) NULL  );

ALTER TABLE MMOD ADD ( MMOD_FTP_USE_SSL NUMBER(1) NULL  );

ALTER TABLE MMOD ADD ( MMOD_FTP_PROTOCOL NUMBER(1) NULL  );

ALTER TABLE MMOD ADD ( MMOD_FTP_ENCRYPTION NUMBER(1) NULL  );

ALTER TABLE MMOD ADD ( MMOD_FTP_LOGON_TYPE NUMBER(1) NULL  );

ALTER TABLE MMOD ADD ( MMOD_FTP_LOGLEVEL NUMBER(1) NULL  );

ALTER TABLE MMOD ADD ( MMOD_FTP_CERTIFICATE VARCHAR2(100) NULL  );

ALTER TABLE MMOD ADD ( MMOD_FTP_CERT_PWD VARCHAR2(1024) NULL  );

ALTER TABLE MMOD ADD ( MMOD_FTP_COMPRESSION NUMBER(1) NULL  );

ALTER TABLE MMOD ADD ( MMOD_FTP_ENCRYPT_DATACHANNEL NUMBER(1) NULL  );

ALTER TABLE MMOD ADD ( MMOD_FTP_CERT_FORMAT NUMBER(1) NULL  );

ALTER TABLE RRES ADD ( RRES_FIXED NUMBER(1) NULL  );

ALTER TABLE RTAB ADD ( RTAB_INACTIVE NUMBER(1) NULL  );

ALTER TABLE W8HP ADD ( W8HP_FACEBOOKBUTTON NUMBER(1) NULL  );

ALTER TABLE W8HP ADD ( W8HP_TWITTERBUTTON NUMBER(1) NULL  );

ALTER TABLE W8HP ADD ( W8HP_GOOGLEPLUS NUMBER(1) NULL  );

ALTER TABLE WACT ADD ( WACT_FIDCRSID VARCHAR2(20) NULL  );

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

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

ALTER TABLE WACT ADD ( WACT_REMINDERSTATE NUMBER(1) NULL  );

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

ALTER TABLE WATG ADD ( WATG_FA NUMBER(1) NULL  );

ALTER TABLE WATY ADD ( WATY_REMINDAFTER2 NUMBER(10) NULL  );

ALTER TABLE WAVL ADD ( WAVL_WCOL1 NUMBER(30) NULL  );

ALTER TABLE WAVL ADD ( WAVL_WCOL2 NUMBER(30) NULL  );

ALTER TABLE WAVL ADD ( WAVL_WCOL3 NUMBER(30) NULL  );

ALTER TABLE WAVL ADD ( WAVL_WCOL4 NUMBER(30) NULL  );

ALTER TABLE WAVL ADD ( WAVL_FULLYOCCUPIED_WCOL NUMBER(30) NULL  );

ALTER TABLE WDCG ADD ( WDCG_STORAGETYPE NUMBER(1) NULL  );

ALTER TABLE WDCG ADD ( WDCG_DEFWIDTH NUMBER(10) NULL  );

ALTER TABLE WDCG ADD ( WDCG_DEFHEIGHT NUMBER(10) NULL  );

ALTER TABLE WDCL ADD ( WDCL_WIMG_ID NUMBER(30) NULL  );

ALTER TABLE WIMG ADD ( WIMG_COMPRESSED NUMBER(1) NULL  );

ALTER TABLE WMSL ADD ( WMSL_DEFAULT NUMBER(1) NULL  );

ALTER TABLE WPHS ADD ( WPHS_CRSPAIRCODE VARCHAR2(5) NULL  );

ALTER TABLE WRPT ADD ( WRPT_AUTOICS NUMBER(1) NULL  );

ALTER TABLE WSKL ADD ( WSKL_SW_ASSIGN NUMBER(1) NULL  );

ALTER TABLE WSKL ADD ( WSKL_ASN_SMS NUMBER(1) NULL  );

ALTER TABLE WSKL ADD ( WSKL_ASN_EMAIL NUMBER(1) NULL  );

ALTER TABLE WSKL ADD ( WSKL_SW_REMOVE NUMBER(1) NULL  );

ALTER TABLE WSKL ADD ( WSKL_RMV_SMS NUMBER(1) NULL  );

ALTER TABLE WSKL ADD ( WSKL_RMV_EMAIL NUMBER(1) NULL  );

ALTER TABLE WSKL ADD ( WSKL_DUEMINL1 NUMBER(10) NULL  );

ALTER TABLE WSKL ADD ( WSKL_DML1_SMS NUMBER(1) NULL  );

ALTER TABLE WSKL ADD ( WSKL_DML1_EMAIL NUMBER(1) NULL  );

ALTER TABLE WSKL ADD ( WSKL_DUEMINL2 NUMBER(10) NULL  );

ALTER TABLE WSKL ADD ( WSKL_DML2_SMS NUMBER(1) NULL  );

ALTER TABLE WSKL ADD ( WSKL_DML2_EMAIL NUMBER(1) NULL  );

ALTER TABLE WSKL ADD ( WSKL_REMINDERMIN NUMBER(10) NULL  );

ALTER TABLE WSKL ADD ( WSKL_RMD_SMS NUMBER(1) NULL  );

ALTER TABLE WSKL ADD ( WSKL_RMD_EMAIL NUMBER(1) NULL  );

ALTER TABLE WSKL ADD ( WSKL_SKILLED NUMBER(1) NULL  );

ALTER TABLE WSKL ADD ( WSKL_USEDEFAULTMIN NUMBER(1) NULL  );

ALTER TABLE WSKL ADD ( WSKL_SW_UPDATE NUMBER(1) NULL  );

ALTER TABLE WSKL ADD ( WSKL_UPDT_SMS NUMBER(1) NULL  );

ALTER TABLE WSKL ADD ( WSKL_UPDT_EMAIL NUMBER(1) NULL  );

ALTER TABLE WSKL ADD ( WSKL_SW_NEWTASK NUMBER(1) NULL  );

ALTER TABLE WSKL ADD ( WSKL_NEW_SMS NUMBER(1) NULL  );

ALTER TABLE WSKL ADD ( WSKL_NEW_EMAIL NUMBER(1) NULL  );

ALTER TABLE WSQL ADD ( WSQL_ROWLIMIT NUMBER(30) NULL  );

ALTER TABLE XADR ADD ( XADR_FIDCRSID VARCHAR2(20) NULL  );

ALTER TABLE XCCS ADD ( XCCS_FIDCRSID VARCHAR2(60) NULL  );

ALTER TABLE XCED ADD ( XCED_IGNORE_NA_CHECK NUMBER(1) NULL  );

ALTER TABLE XCED ADD ( XCED_MOD NUMBER(1) NULL  );

ALTER TABLE XCID ADD ( XCID_ALT_LETTGREET VARCHAR2(60) NULL  );

ALTER TABLE XCMS ADD ( XCMS_SYNCFAILCOUNT NUMBER(3) NULL  );

ALTER TABLE XCMS ADD ( XCMS_NOTINACTIVEBEFORE DATE NULL  );

ALTER TABLE XCNO ADD ( XCNO_FIDCRSID VARCHAR2(20) NULL  );

ALTER TABLE XCOM ADD ( XCOM_FIDCRSID VARCHAR2(20) NULL  );

ALTER TABLE XMNR MODIFY ( XMNR_VALUE VARCHAR2(100) );

ALTER TABLE XPDC ADD ( XPDC_FIDCRSID VARCHAR2(20) NULL  );

ALTER TABLE XPRM ADD ( XPRM_REASON VARCHAR2(2000) NULL  );

ALTER TABLE YBOM ADD ( YBOM_XOPP_ID NUMBER(30) NULL  );

ALTER TABLE YCDR ADD ( YCDR_HOURLYFEE NUMBER(1) NULL  );

ALTER TABLE YCDR ADD ( YCDR_HOURS NUMBER(1) NULL  );

ALTER TABLE YCDR ADD ( YCDR_DEFHOURLYFEE NUMBER(1) NULL  );

ALTER TABLE YCEP ADD ( YCEP_TICKETPRICE NUMBER(30,4) NULL  );

ALTER TABLE YCEP ADD ( YCEP_AMOUNT NUMBER(30,4) NULL  );

ALTER TABLE YCEP ADD ( YCEP_ZFAC_ID NUMBER(30) NULL  );

ALTER TABLE YCEP ADD ( YCEP_VOID_ZFAC_ID NUMBER(30) NULL  );

ALTER TABLE YCEP ADD ( YCEP_FULLYPAID NUMBER(1) NULL  );

ALTER TABLE YCEP ADD ( YCEP_PRINTED NUMBER(1) NULL  );

ALTER TABLE YCEP ADD ( YCEP_NOTES VARCHAR2(1000) NULL  );

ALTER TABLE YCET ADD ( YCET_TICKETBILLING NUMBER(1) NULL  );

ALTER TABLE YCEV ADD ( YCEV_TICKETBILLING NUMBER(1) NULL  );

ALTER TABLE YCEV ADD ( YCEV_YCER_ID NUMBER(30) NULL  );

ALTER TABLE YCEV ADD ( YCEV_AVLINFLUENCELEVEL NUMBER(1) NULL  );

ALTER TABLE YCMP ADD ( YCMP_FIDCRSID VARCHAR2(20) NULL  );

ALTER TABLE YCRS ADD ( YCRS_FIRSTTRANSFER DATE NULL  );

ALTER TABLE YCRS ADD ( YCRS_LOCALUPDATETIMESTAMP DATE NULL  );

ALTER TABLE YCRS ADD ( YCRS_DELETED DATE NULL  );

ALTER TABLE YEBS ADD ( YEBS_STARTDATE DATE NULL  );

ALTER TABLE YEBS ADD ( YEBS_ENDDATE DATE NULL  );

ALTER TABLE YETY ADD ( YETY_ROLE NUMBER(1) NULL  );

ALTER TABLE YEVM ADD ( YEVM_STARTDATE DATE NULL  );

ALTER TABLE YFRE ADD ( YFRE_CALCSTATUS NUMBER(1) NULL  );

ALTER TABLE YFRE ADD ( YFRE_NOAVAILREASON NUMBER(1) NULL  );

ALTER TABLE YFRE ADD ( YFRE_ACTARRTIME DATE NULL  );

ALTER TABLE YFRE ADD ( YFRE_ACTDEPTIME DATE NULL  );

ALTER TABLE YFSC ADD ( YFSC_YCAD_ID NUMBER(30) NULL  );

ALTER TABLE YGRP ADD ( YGRP_EXCHRATE NUMBER(10,4) NULL  );

ALTER TABLE YGRP ADD ( YGRP_BACKRATE NUMBER(10,4) NULL  );

ALTER TABLE YGRP ADD ( YGRP_ZCUR_ID NUMBER(30) NULL  );

ALTER TABLE YHRI ADD ( YHRI_OCCUPANCY NUMBER(10) NULL  );

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

ALTER TABLE YPRD ADD ( YPRD_STAYDATERANGE NUMBER(1) NULL  );

ALTER TABLE YPRG ADD ( YPRG_ISBREAKFAST NUMBER(1) NULL  );

ALTER TABLE YRCH ADD ( YRCH_FAVOURITE NUMBER(1) NULL  );

ALTER TABLE YRCL ADD ( YRCL_FIDCRSID VARCHAR2(60) NULL  );

ALTER TABLE YRMS ADD ( YRMS_IGNORE_NA_CHECK NUMBER(1) NULL  );

ALTER TABLE YRMS ADD ( YRMS_WALKORDER NUMBER(5) NULL  );

ALTER TABLE ZBST ADD ( ZBST_DRAFT NUMBER(1) NULL  );

ALTER TABLE ZDTL ADD ( ZDTL_IGNORE_NA_CHECK NUMBER(1) NULL  );

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

ALTER TABLE ZOTA ADD ( ZOTA_BACKUP NUMBER(1) NULL  );

ALTER TABLE ZOTA ADD ( ZOTA_REQ_BACKUP VARCHAR2(100) NULL  );

ALTER TABLE ZOTA ADD ( ZOTA_RSP_BACKUP VARCHAR2(100) NULL  );

ALTER TABLE ZOTA ADD ( ZOTA_SYNC_INTERVAL NUMBER(4) NULL  );

ALTER TABLE ZTCD ADD ( ZTCD_IGNORE_NA_CHECK NUMBER(1) NULL  );

ALTER TABLE ZWIN ADD ( ZWIN_ZRDF_ID NUMBER(30) NULL  );

ALTER TABLE YCRF MODIFY ( YCRF_CROSSREF_9 VARCHAR2(400) );

ALTER TABLE MCFG MODIFY MCFG_DISP_APPPATH VARCHAR2(100) NULL;

ALTER TABLE MCFG MODIFY MCFG_MSMQ_EVENT NUMBER(1) NULL;

ALTER TABLE MCFG MODIFY MCFG_REQUEST_QUEUE VARCHAR2(30) NULL;

ALTER TABLE MCFG MODIFY MCFG_RESPONSE_QUEUE VARCHAR2(30) NULL;

ALTER TABLE MCFG MODIFY MCFG_REQUEST_BACKUP VARCHAR2(100);

ALTER TABLE MCFG MODIFY MCFG_RESPONSE_BACKUP VARCHAR2(100);

ALTER TABLE MCFG MODIFY MCFG_MAP_APPPATH VARCHAR2(100) NULL;

ALTER TABLE MCFG MODIFY MCFG_NUMBER_OF_THREADS NUMBER(2) NULL;

ALTER TABLE MCFG MODIFY MCFG_READ_PURGE_DAYS NUMBER(2) NULL;

ALTER TABLE WNAE MODIFY WNAE_DATA_SQL VARCHAR2(4000);


/************************************************************************************************************************
*
*  The following statements will change the COMMON tables
*
************************************************************************************************************************/

ALTER TABLE IERR ADD ( IERR_REQ_TYPE_TMP NUMBER(3) );

UPDATE IERR SET IERR_REQ_TYPE_TMP=IERR_REQ_TYPE; 

ALTER TABLE IERR DROP COLUMN IERR_REQ_TYPE;

ALTER TABLE IERR RENAME COLUMN IERR_REQ_TYPE_TMP TO IERR_REQ_TYPE;


DELETE FROM WICL;

ALTER TABLE WICL DROP COLUMN WICL_MSG;

ALTER TABLE WICL ADD WICL_MSG VARCHAR2(2000);


ALTER TABLE YDET ADD YDET_RATEDISCOUNTPERC_TMP NUMBER(5,2) DEFAULT 0;

UPDATE YDET SET YDET_RATEDISCOUNTPERC_TMP=YDET_RATEDISCOUNTPERC WHERE NVL(YDET_RATEDISCOUNTPERC,0)>0;

ALTER TABLE YDET DROP COLUMN YDET_RATEDISCOUNTPERC; 

ALTER TABLE YDET RENAME COLUMN YDET_RATEDISCOUNTPERC_TMP TO YDET_RATEDISCOUNTPERC;


update yres set yres_confirmationno=to_char(yres_id) where yres_confirmationno is null;

ALTER TABLE YRES MODIFY YRES_CONFIRMATIONNO NOT NULL;

ALTER TABLE YRES ADD CONSTRAINT YRES_CONFIRMATIONNOUNIQUE UNIQUE (YRES_CONFIRMATIONNO) USING INDEX TABLESPACE V8INDEX;


ALTER TABLE YHRI RENAME COLUMN YHRI_ARRDATE TO YHRI_DATE;


/************************************************************************************************************************
*
*  The following statements will upgrade constraints for table YCRS
*
************************************************************************************************************************/

ALTER TABLE YCRS ADD (
	CONSTRAINT YCRS_GLOBALIDUNIQUE
	UNIQUE
	       (
	        YCRS_GLOBALID
	       ,YCRS_TABLENAME
	       )
	USING INDEX
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
)
;


/************************************************************************************************************************
*
*  The following statements will upgrade constraints for table YRES
*
************************************************************************************************************************/

ALTER TABLE YRES ADD (
	CONSTRAINT YRES_CONFIRMATIONNOUNIQUE
	UNIQUE
	       (
	        YRES_CONFIRMATIONNO
	       )
	USING INDEX
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
)
;


/************************************************************************************************************************
*
*  The following statements will upgrade the data
*
************************************************************************************************************************/

INSERT INTO ZFST (ZFST_ID, ZFST_LONGDESC, ZFST_WRPT_ID, ZFST_DEFAULT, ZFST_DISPLORDER, ZFST_INACTIVE, ZFST_ZINN_ID, ZFST_PURPOSE, ZFST_NDC) VALUES (SEQ_ZFST.NEXTVAL,'Paid Out',(SELECT WUSS_VALUE FROM WUSS WHERE WUSS_XCMS_ID=0 AND WUSS_NAME='paidoutreceipt'),0,(SELECT MAX(ZFST_DISPLORDER)+1 FROM ZFST),0,NULL,0,0); 

DELETE FROM WUSS WHERE WUSS_NAME='BlocksInMealplanForecast';

INSERT INTO WUSS (WUSS_ID,WUSS_XCMS_ID,WUSS_NAME,WUSS_VALUE) VALUES (SEQ_WUSS.NEXTVAL,0,'BlocksInMealplanForecast','1');

UPDATE YBLH SET YBLH_ADDTOMEALPLAN = 1;

UPDATE YCEP SET YCEP_NOOFADULTS = 1 WHERE NVL(YCEP_NOOFADULTS,0) = 0;

UPDATE YCET SET YCET_ADDATTENDEES = 1 WHERE YCET_ID IN (SELECT YCET_ID FROM YCET, YCEP, YCEV WHERE YCEP_YCEV_ID = YCEV_ID AND YCEV_YCET_ID = YCET_ID);

INSERT INTO WSKL ( WSKL_ID, WSKL_XCMS_ID, WSKL_WATY_ID, WSKL_DISPLORDER) (SELECT  SEQ_WSKL.NEXTVAL, WATY_XCED_ID, WATY_ID , 1 FROM WATY WHERE WATY_XCED_ID IS NOT NULL);

UPDATE WATY SET WATY_PRIORITY = 0 WHERE WATY_PRIORITY IS NULL;

UPDATE WUSS SET WUSS_NAME = 'Maintenance Resolved' WHERE WUSS_NAME = 'Resolved' AND WUSS_XCMS_ID = 0; 

UPDATE WUSS SET WUSS_NAME = 'Maintenance Unresolved' WHERE WUSS_NAME = 'Unresolved' AND WUSS_XCMS_ID = 0; 

UPDATE WUSS SET WUSS_NAME = 'Cancel Table Reservation' WHERE WUSS_NAME = 'Cancel' AND WUSS_XCMS_ID = 0 ;

UPDATE WUSS SET WUSS_NAME = 'Reinstate Table Reservation' WHERE WUSS_NAME = 'Reinstate' AND WUSS_XCMS_ID = 0;

UPDATE WUSS SET WUSS_NAME = 'Redeem Voucher' WHERE WUSS_NAME = 'Redeem' AND WUSS_XCMS_ID = 0;

INSERT INTO WINT(WINT_ID, WINT_INTERVAL, WINT_INTERVALTYPE, WINT_SNAP) (SELECT SEQ_WINT.NEXTVAL, 30, 0, 1 FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM WINT WHERE WINT_INTERVAL = 30 AND WINT_INTERVALTYPE = 0 AND WINT_SNAP = 1));

INSERT INTO WINT(WINT_ID, WINT_INTERVAL, WINT_INTERVALTYPE, WINT_SNAP) (SELECT SEQ_WINT.NEXTVAL, 1, 1, 0 FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM WINT WHERE WINT_INTERVAL = 1 AND WINT_INTERVALTYPE = 1 AND WINT_SNAP = 0));

INSERT INTO WINT(WINT_ID, WINT_INTERVAL, WINT_INTERVALTYPE, WINT_SNAP) (SELECT SEQ_WINT.NEXTVAL, 4, 1, 0 FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM WINT WHERE WINT_INTERVAL = 4 AND WINT_INTERVALTYPE = 1 AND WINT_SNAP = 0));

INSERT INTO WINT(WINT_ID, WINT_INTERVAL, WINT_INTERVALTYPE, WINT_SNAP) (SELECT SEQ_WINT.NEXTVAL, 1, 3, 0 FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM WINT WHERE WINT_INTERVAL = 1 AND WINT_INTERVALTYPE = 3 AND WINT_SNAP = 0));

INSERT INTO WINT(WINT_ID, WINT_INTERVAL, WINT_INTERVALTYPE, WINT_SNAP) (SELECT SEQ_WINT.NEXTVAL, 2, 3, 0 FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM WINT WHERE WINT_INTERVAL = 2 AND WINT_INTERVALTYPE = 3 AND WINT_SNAP = 0));

INSERT INTO WINT(WINT_ID, WINT_INTERVAL, WINT_INTERVALTYPE, WINT_SNAP) (SELECT SEQ_WINT.NEXTVAL, 1, 4, 0 FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM WINT WHERE WINT_INTERVAL = 1 AND WINT_INTERVALTYPE = 4 AND WINT_SNAP = 0));

UPDATE WUSS SET WUSS_VALUE=(SELECT MIN(WINT_ID) FROM WINT WHERE NVL(WINT_SNAP, 0) =1 ) WHERE WUSS_NAME='TableReservationSnap';

UPDATE YEST SET YEST.YEST_POSTREVENUE=1;

INSERT INTO WUSS(WUSS_ID, WUSS_XCMS_ID, WUSS_NAME, WUSS_VALUE) SELECT SEQ_WUSS.NEXTVAL, 0, 'SupervisorUserGroup', (SELECT WEGR_ID FROM WEGR WHERE WEGR_SHORTDESC='SUP' AND ROWNUM = 1) FROM DUAL WHERE ( (SELECT COUNT(WUSS_ID) FROM WUSS WHERE WUSS_NAME = 'SupervisorUserGroup') = 0 ) AND ( (SELECT COUNT(WEGR_ID) FROM WEGR WHERE WEGR_SHORTDESC='SUP') > 0);

UPDATE YBIS SET YBIS_FROM_YRES_ID = NULL WHERE  YBIS_FROM_YRES_ID = 0;

UPDATE YBIS SET YBIS_FROM_ZFAC_ID = NULL WHERE  YBIS_FROM_ZFAC_ID = 0;

UPDATE YBIS SET YBIS_TO_ZFAC_ID = NULL WHERE  YBIS_TO_ZFAC_ID = 0;

UPDATE YBIS SET YBIS_TO_YRES_ID = NULL WHERE  YBIS_TO_YRES_ID = 0;

UPDATE YCMC SET YCMC_ROLE = 1;

UPDATE YRES SET YRES.YRES_ORGDEPTIME=(YRES.YRES_ORGDEPTIME)+1 WHERE YRES.YRES_ID IN (SELECT YRES2.YRES_ID FROM YRES YRES2, WLOG WHERE WLOG.WLOG_TYPE=4 AND WLOG.WLOG_TABLE_ID=YRES2.YRES_ID AND WLOG.WLOG_TABLENAME LIKE 'YRES' AND EXISTS 
(SELECT 1 FROM WLOG WLOG2 WHERE WLOG2.WLOG_TYPE=2 AND WLOG2.WLOG_TABLE_ID=YRES2.YRES_ID AND WLOG2.WLOG_TABLENAME LIKE 'YRES' AND TRUNC(WLOG2.WLOG_TIME,'MI')=TRUNC(WLOG.WLOG_TIME,'MI'))) AND TRUNC(YRES.YRES_ACTDEPTIME) = TRUNC(YRES.YRES_ORGDEPTIME);

UPDATE XCAC SET XCAC_XGCA_ID = 0 WHERE XCAC_XGCA_ID IS NULL;

UPDATE YRCH SET YRCH_XGCA_ID = 0 WHERE YRCH_XGCA_ID IS NULL;

UPDATE SHIS SET SHIS_IMPORTED = 0 WHERE SHIS_IMPORTED IS NULL;

UPDATE SFOR SET SFOR_IMPORTED = 0 WHERE SFOR_IMPORTED IS NULL;

UPDATE SMAN SET SMAN_IMPORTED = 0 WHERE SMAN_IMPORTED IS NULL;

UPDATE SRPD SET SRPD_IMPORTED = 0 WHERE SRPD_IMPORTED IS NULL;

UPDATE SAAR SET SAAR_IMPORTED = 0 WHERE SAAR_IMPORTED IS NULL;

UPDATE SBUD SET SBUD_IMPORTED = 0 WHERE SBUD_IMPORTED IS NULL;

UPDATE SMBD SET SMBD_IMPORTED = 0 WHERE SMBD_IMPORTED IS NULL;
  
INSERT INTO YRDE (YRDE_ID, YRDE_YRDD_ID) (SELECT YRDD_ID, YRDD_ID FROM YRDD);

UPDATE YRDY SET YRDY_YRDE_ID =YRDY_YRDD_ID;

UPDATE XCMS SET XCMS_GLOBALID = NULL WHERE XCMS_MERGEDTO_XCMS_ID IS NOT NULL AND NOT EXISTS (SELECT 1 FROM WUSS WHERE WUSS_NAME='ThisHotelIsMaster' and wuss_value=1);

UPDATE YEBS SET YEBS_STARTDATE = TRUNC(YEBS_STARTTIME), YEBS_ENDDATE=TRUNC(YEBS_ENDTIME);

UPDATE YRCO SET YRCO_ALLOWSEND = 5 WHERE YRCO_TIME IS NOT NULL;

UPDATE YEVM SET YEVM_STARTDATE = TRUNC(YEVM.YEVM_STARTTIME);

UPDATE WATY SET WATY_REMINDAFTER2 = WATY_REMINDAFTER * 2;

INSERT INTO WSKL (WSKL_ID, WSKL_XCMS_ID,WSKL_WATY_ID,WSKL_SW_ASSIGN ,WSKL_ASN_EMAIL ,WSKL_ASN_SMS,WSKL_SW_REMOVE ,WSKL_RMV_EMAIL ,WSKL_RMV_SMS,WSKL_USEDEFAULTMIN,WSKL_REMINDERMIN,WSKL_DUEMINL1,WSKL_DUEMINL2,WSKL_DISPLORDER) 
SELECT SEQ_WSKL.NEXTVAL, -9999, WATY_ID,  1,1,WATY_REMINDERSMS,1,1,WATY_REMINDERSMS,1,WATY_REMIND, WATY_REMINDAFTER ,WATY_REMINDAFTER2, 
 NVL( (SELECT MAX(NVL(WSKL_DISPLORDER,0)) FROM WSKL  W2 WHERE W2.WSKL_WATY_ID=W.WATY_ID), 0)+1
FROM WATY W 
 WHERE WATY_WATG_ID = (SELECT WATG_ID FROM WATG WHERE WATG_ROLE=6)
   AND WATY_ID NOT IN (SELECT WSKL_WATY_ID FROM WSKL WHERE WSKL_WATY_ID = WATY_ID AND WSKL_XCMS_ID = -9999);

INSERT INTO WSKL (WSKL_ID, WSKL_XCMS_ID,WSKL_WATY_ID,WSKL_SW_ASSIGN ,WSKL_ASN_EMAIL ,WSKL_ASN_SMS,WSKL_SW_REMOVE ,WSKL_RMV_EMAIL ,WSKL_RMV_SMS,WSKL_USEDEFAULTMIN,WSKL_REMINDERMIN,WSKL_DUEMINL1,WSKL_DUEMINL2,WSKL_DISPLORDER) 
SELECT SEQ_WSKL.NEXTVAL, -9998, WATY_ID,  1,1,WATY_REMINDERSMS,1,1,WATY_REMINDERSMS,1,WATY_REMIND, WATY_REMINDAFTER ,WATY_REMINDAFTER2 ,
  NVL( (SELECT MAX(NVL(WSKL_DISPLORDER,0)) FROM WSKL  W2 WHERE W2.WSKL_WATY_ID=W.WATY_ID), 0) + 1
FROM WATY W 
 WHERE WATY_WATG_ID = (SELECT WATG_ID FROM WATG WHERE WATG_ROLE=6)
   AND WATY_ID NOT IN (SELECT WSKL_WATY_ID FROM WSKL WHERE WSKL_WATY_ID = WATY_ID AND WSKL_XCMS_ID = -9998);

UPDATE YCET SET YCET_ADDATTENDEES = 1 WHERE YCET_ID IN (SELECT YCET_ID FROM YCET, YCEV WHERE YCET_ID = YCEV_YCET_ID AND YCEV_ID IN (SELECT YCEP_YCEV_ID FROM YCEP GROUP BY YCEP_YCEV_ID) GROUP BY YCET_ID);

UPDATE WUSS SET WUSS_VALUE = 1 WHERE WUSS_NAME = 'UseCalendarEventsAttendeeList' AND EXISTS (SELECT 1 FROM YCET WHERE YCET_ADDATTENDEES = 1);

UPDATE YCEP SET YCEP_NOOFADULTS = 1 WHERE NVL(YCEP_NOOFADULTS,0) = 0;

INSERT INTO WUSR (SELECT SEQ_WUSR.NEXTVAL,NULL,WEGR_ID,'Reservationcheckindirty',1 FROM WEGR WHERE NOT EXISTS (SELECT 1 FROM WUSR WHERE WUSR_WEGR_ID=WEGR_ID AND WUSR_NAME='Reservationcheckindirty'));

INSERT INTO WMLG (WMLG_ID, WMLG_TABLENAME, WMLG_TABLE_ID,                  WMLG_FIDELIODATE, WMLG_TIME_CREATION, WMLG_TIME_UPDATE, WMLG_XCMS_CREATION, WMLG_XCMS_UPDATE, WMLG_CREAPRGVERSION, WMLG_CREADBVERSION, WMLG_UPDPRGVERSION, WMLG_UPDDBVERSION)  
(SELECT  SEQ_WMLG.NEXTVAL,         'YGRP',       YGRP_ID, (SELECT WGBS_DATEVALUE FROM WGBS),               NULL,             NULL,               NULL,             NULL,           '8.7.0.0',          '8_9_2_0',               NULL,              NULL 
FROM YGRP WHERE NOT EXISTS (SELECT 1 FROM WMLG WHERE WMLG_TABLENAME='YGRP' AND WMLG_TABLE_ID=YGRP_ID));

COMMIT;


/************************************************************************************************************************
*
*  The following statements will modify existing fields to NOT NULL
*
************************************************************************************************************************/

ALTER TABLE XCAC MODIFY (XCAC_XGCA_ID DEFAULT 0);

ALTER TABLE XCAC MODIFY (XCAC_XGCA_ID NOT NULL);

ALTER TABLE YRCH MODIFY (YRCH_XGCA_ID DEFAULT 0);

ALTER TABLE YRCH MODIFY (YRCH_XGCA_ID NOT NULL);

ALTER TABLE SHIS MODIFY (SHIS_IMPORTED DEFAULT 0);

ALTER TABLE SHIS MODIFY (SHIS_IMPORTED NOT NULL);

ALTER TABLE SFOR MODIFY (SFOR_IMPORTED DEFAULT 0);

ALTER TABLE SFOR MODIFY (SFOR_IMPORTED NOT NULL);

ALTER TABLE SMAN MODIFY (SMAN_IMPORTED DEFAULT 0);

ALTER TABLE SMAN MODIFY (SMAN_IMPORTED NOT NULL);

ALTER TABLE SRPD MODIFY (SRPD_IMPORTED DEFAULT 0);

ALTER TABLE SRPD MODIFY (SRPD_IMPORTED NOT NULL);

ALTER TABLE SAAR MODIFY (SAAR_IMPORTED DEFAULT 0);
                        
ALTER TABLE SAAR MODIFY (SAAR_IMPORTED NOT NULL);
                        
ALTER TABLE SBUD MODIFY (SBUD_IMPORTED DEFAULT 0);
                        
ALTER TABLE SBUD MODIFY (SBUD_IMPORTED NOT NULL);
                        
ALTER TABLE SMBD MODIFY (SMBD_IMPORTED DEFAULT 0);
                        
ALTER TABLE SMBD MODIFY (SMBD_IMPORTED NOT NULL);

COMMIT;

   
--- End of DBDiff for Oracle --- Elapsed Time: 00:18:42 ---
