/************************************************************************************************************************
*
*
*  Date: December 17, 2014  09:22:45
*
*  This upgrade script was automatically generated by DBDiff for Oracle (www.dbdiff.com)
*
*  SOURCE DATABASE:  VERSION_8_9_6@V8TEST2
*  TARGET DATABASE:  VERSION_8_9_5@V8TEST2
*
*  This script should be executed as VERSION_8_9_5 in database VERSION_8_9_5@V8TEST2 except where otherwise noted.
*
*  IMPORTANT:  As with any script, you should always perform a sanity check before executing it in your target database.
*
*  
************************************************************************************************************************/




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

CREATE SEQUENCE SEQ_CSCO INCREMENT BY 1 START WITH 1000 NOMAXVALUE MINVALUE 1 NOCYCLE NOCACHE NOORDER;
CREATE SEQUENCE SEQ_CSHC INCREMENT BY 1 START WITH 1000 NOMAXVALUE MINVALUE 1 NOCYCLE NOCACHE NOORDER;
CREATE SEQUENCE SEQ_CSHP INCREMENT BY 1 START WITH 1000 NOMAXVALUE MINVALUE 1 NOCYCLE NOCACHE NOORDER;
CREATE SEQUENCE SEQ_WCCS INCREMENT BY 1 START WITH 1000 NOMAXVALUE MINVALUE 1 NOCYCLE NOCACHE NOORDER;
CREATE SEQUENCE SEQ_WECF INCREMENT BY 1 START WITH 1000 NOMAXVALUE MINVALUE 1 NOCYCLE NOCACHE NOORDER;
CREATE SEQUENCE SEQ_WLHC INCREMENT BY 1 START WITH 1000 NOMAXVALUE MINVALUE 1 NOCYCLE NOCACHE NOORDER;
CREATE SEQUENCE SEQ_WMWC INCREMENT BY 1 START WITH 1000 NOMAXVALUE MINVALUE 1 NOCYCLE NOCACHE NOORDER;
CREATE SEQUENCE SEQ_WMWD INCREMENT BY 1 START WITH 1000 NOMAXVALUE MINVALUE 1 NOCYCLE NOCACHE NOORDER;
CREATE SEQUENCE SEQ_WMWE INCREMENT BY 1 START WITH 1000 NOMAXVALUE MINVALUE 1 NOCYCLE NOCACHE NOORDER;
CREATE SEQUENCE SEQ_WMWF INCREMENT BY 1 START WITH 1000 NOMAXVALUE MINVALUE 1 NOCYCLE NOCACHE NOORDER;
CREATE SEQUENCE SEQ_WMWG INCREMENT BY 1 START WITH 1000 NOMAXVALUE MINVALUE 1 NOCYCLE NOCACHE NOORDER;
CREATE SEQUENCE SEQ_WMWL INCREMENT BY 1 START WITH 1000 NOMAXVALUE MINVALUE 1 NOCYCLE NOCACHE NOORDER;
CREATE SEQUENCE SEQ_WMWM INCREMENT BY 1 START WITH 1000 NOMAXVALUE MINVALUE 1 NOCYCLE NOCACHE NOORDER;
CREATE SEQUENCE SEQ_WMWP INCREMENT BY 1 START WITH 1000 NOMAXVALUE MINVALUE 1 NOCYCLE NOCACHE NOORDER;
CREATE SEQUENCE SEQ_WSIG INCREMENT BY 1 START WITH 1000 NOMAXVALUE MINVALUE 1 NOCYCLE NOCACHE NOORDER;
CREATE SEQUENCE SEQ_WSMC INCREMENT BY 1 START WITH 1000 NOMAXVALUE MINVALUE 1 NOCYCLE NOCACHE NOORDER;
CREATE SEQUENCE SEQ_WSML INCREMENT BY 1 START WITH 1000 NOMAXVALUE MINVALUE 1 NOCYCLE NOCACHE NOORDER;
CREATE SEQUENCE SEQ_WSQP INCREMENT BY 1 START WITH 1000 NOMAXVALUE MINVALUE 1 NOCYCLE NOCACHE NOORDER;
CREATE SEQUENCE SEQ_XPAD INCREMENT BY 1 START WITH 1000 NOMAXVALUE MINVALUE 1 NOCYCLE NOCACHE NOORDER;
CREATE SEQUENCE SEQ_YFOR INCREMENT BY 1 START WITH 1000 NOMAXVALUE MINVALUE 1 NOCYCLE NOCACHE NOORDER;
CREATE SEQUENCE SEQ_YRDM INCREMENT BY 1 START WITH 1000 NOMAXVALUE MINVALUE 1 NOCYCLE NOCACHE NOORDER;



/************************************************************************************************************************
*
*  tables
*
*  1046 tables were found in VERSION_8_9_6@V8TEST2
*  1030 tables were found in VERSION_8_9_5@V8TEST2
*
************************************************************************************************************************/




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


DROP TABLE VERSION_8_9_5_6;


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


/*  CSCO  */
CREATE TABLE CSCO (
	 CSCO_ID	NUMBER(30)	NOT NULL
	,CSCO_XCOU_ID	NUMBER(30)	NOT NULL
	,CSCO_CSHP_ID	NUMBER(30)	NOT NULL
)
TABLESPACE V8CONF
    STORAGE (
	INITIAL 64K
	NEXT 1M
	MINEXTENTS 1
	MAXEXTENTS 2147483645
	PCTINCREASE 50 
	FREELISTS 1 FREELIST GROUPS 1
        )
;

ALTER TABLE CSCO ADD (
	CONSTRAINT CSCO_PK
	PRIMARY KEY
	            (
	             CSCO_ID
	            )
	USING INDEX
	TABLESPACE V8INDEX
)
;

/*  CSHC  */
CREATE TABLE CSHC (
	 CSHC_ID	NUMBER(30)	NOT NULL
	,CSHC_CSHP_ID	NUMBER(30)	NOT NULL
	,CSHC_ZDCO_ID	NUMBER(30)	NOT NULL
	,CSHC_PRICE	NUMBER(30,4)	    NULL
)
TABLESPACE V8CONF
    STORAGE (
	INITIAL 64K
	NEXT 1M
	MINEXTENTS 1
	MAXEXTENTS 2147483645
	PCTINCREASE 50 
	FREELISTS 1 FREELIST GROUPS 1
        )
;

ALTER TABLE CSHC ADD (
	CONSTRAINT CSHC_PK
	PRIMARY KEY
	            (
	             CSHC_ID
	            )
	USING INDEX
	TABLESPACE V8INDEX
)
;

/*  CSHP  */
CREATE TABLE CSHP (
	 CSHP_ID	NUMBER(30)	NOT NULL
	,CSHP_NAME	VARCHAR2(300)	NOT NULL
	,CSHP_WEBENABLED	NUMBER(1)	    NULL
	,CSHP_WEBDESCRIPTION	VARCHAR2(300)	    NULL
	,CSHP_FOLIODESCRIPTION	VARCHAR2(300)	    NULL
	,CSHP_FREEWHENTOTALMORE	NUMBER(30,4)	    NULL
	,CSHP_ROLE	NUMBER(2)	    NULL
	,CSHP_INSTANTPAYMENT	NUMBER(1)	    NULL
	,CSHP_DISPLORDER	NUMBER(4)	    NULL
)
TABLESPACE V8CONF
    STORAGE (
	INITIAL 64K
	NEXT 1M
	MINEXTENTS 1
	MAXEXTENTS 2147483645
	PCTINCREASE 50 
	FREELISTS 1 FREELIST GROUPS 1
        )
;

ALTER TABLE CSHP ADD (
	CONSTRAINT CSHP_PK
	PRIMARY KEY
	            (
	             CSHP_ID
	            )
	USING INDEX
	TABLESPACE V8INDEX
)
;

/*  VERSION_8_9_6_0  */
CREATE TABLE VERSION_8_9_6_0 (
	 DUMMY	NUMBER	    NULL
)
TABLESPACE V8MAIN
    STORAGE (
	INITIAL 64K
	NEXT 1M
	MINEXTENTS 1
	MAXEXTENTS 2147483645
	PCTINCREASE 50 
	FREELISTS 1 FREELIST GROUPS 1
        )
;


/*  WCCS  */
CREATE TABLE WCCS (
	 WCCS_ID	NUMBER(30)	NOT NULL
	,WCCS_TABLENAME	VARCHAR2(4)	NOT NULL
	,WCCS_TABLEID	NUMBER(30)	NOT NULL
	,WCCS_WPHS_ID	NUMBER(30)	NOT NULL
)
TABLESPACE V8MAIN
    STORAGE (
	INITIAL 64K
	NEXT 1M
	MINEXTENTS 1
	MAXEXTENTS 2147483645
	PCTINCREASE 50 
	FREELISTS 1 FREELIST GROUPS 1
        )
;

ALTER TABLE WCCS ADD (
	CONSTRAINT WCCS_PK
	PRIMARY KEY
	            (
	             WCCS_ID
	            )
	USING INDEX
	TABLESPACE V8INDEX
)
;
ALTER TABLE WCCS ADD (
	CONSTRAINT WCCS_UNIQUE
	UNIQUE
	       (
	        WCCS_TABLENAME
	       ,WCCS_TABLEID
	       ,WCCS_WPHS_ID
	       )
	USING INDEX
	TABLESPACE V8INDEX
)
;

/*  WECF  */
CREATE TABLE WECF (
	 WECF_ID	NUMBER(30)	NOT NULL
	,WECF_AREA	NUMBER(3)	NOT NULL
	,WECF_CC	VARCHAR2(60)	    NULL
	,WECF_BCC	VARCHAR2(60)	    NULL
)
TABLESPACE V8MAIN
    STORAGE (
	INITIAL 64K
	NEXT 1M
	MINEXTENTS 1
	MAXEXTENTS 2147483645
	PCTINCREASE 50 
	FREELISTS 1 FREELIST GROUPS 1
        )
;

ALTER TABLE WECF ADD (
	CONSTRAINT WECF_PK
	PRIMARY KEY
	            (
	             WECF_ID
	            )
	USING INDEX
	TABLESPACE V8INDEX
)
;

/*  WLHC  */
CREATE TABLE WLHC (
	 WLHC_ID	NUMBER(30)	NOT NULL
	,WLHC_DATE	DATE	NOT NULL
	,WLHC_YRES_ID	NUMBER(30)	NOT NULL
	,WLHC_REVIEW	VARCHAR2(4000)	NOT NULL
	,WLHC_REPLY	VARCHAR2(2000)	    NULL
	,WLHC_SUCCESS	NUMBER(1)	    NULL
)
TABLESPACE V8MAIN
    STORAGE (
	INITIAL 64K
	NEXT 1M
	MINEXTENTS 1
	MAXEXTENTS 2147483645
	PCTINCREASE 50 
	FREELISTS 1 FREELIST GROUPS 1
        )
;

ALTER TABLE WLHC ADD (
	CONSTRAINT WLHC_PK
	PRIMARY KEY
	            (
	             WLHC_ID
	            )
	USING INDEX
	TABLESPACE V8INDEX
)
;

/*  WMWC  */
CREATE TABLE WMWC (
	 WMWC_ID	NUMBER(30)	NOT NULL
	,WMWC_SHORTDESC	VARCHAR2(3)	    NULL
	,WMWC_LONGDESC	VARCHAR2(100)	    NULL
	,WMWC_WSQG_ID	NUMBER(30)	    NULL
	,WMWC_WSQL_ID	NUMBER(30)	    NULL
	,WMWC_CREATED_XCED_ID	NUMBER(30)	    NULL
	,WMWC_TIME_CREATED	DATE	    NULL
	,WMWC_FIXED	NUMBER(1)	    NULL
	,WMWC_DISPLORDER	NUMBER(4)	    NULL
	,WMWC_REMARKS	VARCHAR2(2000)	    NULL
	,WMWC_TECHNICAL_INFO	VARCHAR2(2000)	    NULL
)
TABLESPACE V8MAIN
    STORAGE (
	INITIAL 64K
	NEXT 1M
	MINEXTENTS 1
	MAXEXTENTS 2147483645
	PCTINCREASE 50 
	FREELISTS 1 FREELIST GROUPS 1
        )
;

ALTER TABLE WMWC ADD (
	CONSTRAINT WMWC_PK
	PRIMARY KEY
	            (
	             WMWC_ID
	            )
	USING INDEX
	TABLESPACE V8INDEX
)
;

/*  WMWD  */
CREATE TABLE WMWD (
	 WMWD_ID	NUMBER(30)	NOT NULL
	,WMWD_SHORTDESC	VARCHAR2(3)	    NULL
	,WMWD_LONGDESC	VARCHAR2(60)	    NULL
	,WMWD_WMWM_ID	NUMBER(30)	NOT NULL
	,WMWD_SQL_SETUP	LONG	    NULL
	,WMWD_DISPLORDER	NUMBER(4)	    NULL
	,WMWD_REMARKS	VARCHAR2(2000)	    NULL
)
TABLESPACE V8MAIN
    STORAGE (
	INITIAL 64K
	NEXT 1M
	MINEXTENTS 1
	MAXEXTENTS 2147483645
	PCTINCREASE 50 
	FREELISTS 1 FREELIST GROUPS 1
        )
;

ALTER TABLE WMWD ADD (
	CONSTRAINT WMWD_PK
	PRIMARY KEY
	            (
	             WMWD_ID
	            )
	USING INDEX
	TABLESPACE V8INDEX
)
;

/*  WMWE  */
CREATE TABLE WMWE (
	 WMWE_ID	NUMBER(30)	NOT NULL
	,WMWE_SHORTDESC	VARCHAR2(3)	    NULL
	,WMWE_LONGDESC	VARCHAR2(100)	    NULL
	,WMWE_WMWC_ID	NUMBER(30)	    NULL
	,WMWE_TIME	DATE	    NULL
	,WMWE_XCED_ID	NUMBER(30)	NOT NULL
	,WMWE_WSQG_ID	NUMBER(30)	    NULL
	,WMWE_WSQL_ID	NUMBER(30)	    NULL
	,WMWE_RESULTCOUNT	NUMBER(10)	    NULL
	,WMWE_RESULTXCMS	LONG	    NULL
	,WMWE_REMARKS	VARCHAR2(2000)	    NULL
	,WMWE_TECHNICAL_INFO	VARCHAR2(2000)	    NULL
	,WMWE_WACT_TYPE	NUMBER(1)	    NULL
)
TABLESPACE V8MAIN
    STORAGE (
	INITIAL 64K
	NEXT 1M
	MINEXTENTS 1
	MAXEXTENTS 2147483645
	PCTINCREASE 50 
	FREELISTS 1 FREELIST GROUPS 1
        )
;

ALTER TABLE WMWE ADD (
	CONSTRAINT WMWE_PK
	PRIMARY KEY
	            (
	             WMWE_ID
	            )
	USING INDEX
	TABLESPACE V8INDEX
)
;

/*  WMWF  */
CREATE TABLE WMWF (
	 WMWF_ID	NUMBER(30)	NOT NULL
	,WMWF_SHORTDESC	VARCHAR2(3)	    NULL
	,WMWF_LONGDESC	VARCHAR2(100)	    NULL
	,WMWF_TYPE	NUMBER(1)	    NULL
	,WMWF_TABLE_NAME	VARCHAR2(4)	    NULL
	,WMWF_TABLE_LINK_FIELD	VARCHAR2(30)	    NULL
	,WMWF_DISPLORDER	NUMBER(4)	    NULL
	,WMWF_REMARKS	VARCHAR2(2000)	    NULL
	,WMWF_SQL_SETUP	LONG	    NULL
)
TABLESPACE V8MAIN
    STORAGE (
	INITIAL 64K
	NEXT 1M
	MINEXTENTS 1
	MAXEXTENTS 2147483645
	PCTINCREASE 50 
	FREELISTS 1 FREELIST GROUPS 1
        )
;

ALTER TABLE WMWF ADD (
	CONSTRAINT WMWF_PK
	PRIMARY KEY
	            (
	             WMWF_ID
	            )
	USING INDEX
	TABLESPACE V8INDEX
)
;

/*  WMWG  */
CREATE TABLE WMWG (
	 WMWG_ID	NUMBER(30)	NOT NULL
	,WMWG_SHORTDESC	VARCHAR2(3)	    NULL
	,WMWG_LONGDESC	VARCHAR2(100)	    NULL
	,WMWG_DISPLORDER	NUMBER(4)	    NULL
	,WMWG_REMARKS	VARCHAR2(2000)	    NULL
	,WMWG_SQL_SETUP	LONG	    NULL
)
TABLESPACE V8MAIN
    STORAGE (
	INITIAL 64K
	NEXT 1M
	MINEXTENTS 1
	MAXEXTENTS 2147483645
	PCTINCREASE 50 
	FREELISTS 1 FREELIST GROUPS 1
        )
;

ALTER TABLE WMWG ADD (
	CONSTRAINT WMWG_PK
	PRIMARY KEY
	            (
	             WMWG_ID
	            )
	USING INDEX
	TABLESPACE V8INDEX
)
;

/*  WMWL  */
CREATE TABLE WMWL (
	 WMWL_ID	NUMBER(30)	NOT NULL
	,WMWL_WMWD_ID	NUMBER(30)	    NULL
	,WMWL_WMWD_EXCL	NUMBER(1)	    NULL
	,WMWL_WMWF_ID	NUMBER(30)	    NULL
	,WMWL_WMWG_ID	NUMBER(30)	    NULL
	,WMWL_WSQL_ID	NUMBER(30)	    NULL
	,WMWL_TIMESTAMP	DATE	    NULL
)
TABLESPACE V8MAIN
    STORAGE (
	INITIAL 64K
	NEXT 1M
	MINEXTENTS 1
	MAXEXTENTS 2147483645
	PCTINCREASE 50 
	FREELISTS 1 FREELIST GROUPS 1
        )
;

ALTER TABLE WMWL ADD (
	CONSTRAINT WMWL_PK
	PRIMARY KEY
	            (
	             WMWL_ID
	            )
	USING INDEX
	TABLESPACE V8INDEX
)
;

/*  WMWM  */
CREATE TABLE WMWM (
	 WMWM_ID	NUMBER(30)	NOT NULL
	,WMWM_SHORTDESC	VARCHAR2(3)	    NULL
	,WMWM_LONGDESC	VARCHAR2(60)	    NULL
	,WMWM_DISPLORDER	NUMBER(4)	    NULL
	,WMWM_REMARKS	VARCHAR2(2000)	    NULL
)
TABLESPACE V8MAIN
    STORAGE (
	INITIAL 64K
	NEXT 1M
	MINEXTENTS 1
	MAXEXTENTS 2147483645
	PCTINCREASE 50 
	FREELISTS 1 FREELIST GROUPS 1
        )
;

ALTER TABLE WMWM ADD (
	CONSTRAINT WMWM_PK
	PRIMARY KEY
	            (
	             WMWM_ID
	            )
	USING INDEX
	TABLESPACE V8INDEX
)
;

/*  WMWP  */
CREATE TABLE WMWP (
	 WMWP_ID	NUMBER(30)	NOT NULL
	,WMWP_TYP	NUMBER(1)	    NULL
	,WMWP_WMWD_ID	NUMBER(30)	NOT NULL
	,WMWP_MULTIPLE	NUMBER(1)	    NULL
	,WMWP_TABLE_NAME	VARCHAR2(4)	    NULL
	,WMWP_TABLE_FIELD	VARCHAR2(30)	    NULL
	,WMWP_PARAMETERNAME	VARCHAR2(30)	    NULL
	,WMWP_INTERNAL_SQL	VARCHAR2(2000)	    NULL
	,WMWP_FIELD1	VARCHAR2(30)	    NULL
	,WMWP_FIELD2	VARCHAR2(30)	    NULL
	,WMWP_FIELD3	VARCHAR2(30)	    NULL
	,WMWP_DISPLORDER	NUMBER(4)	    NULL
	,WMWP_REMARKS	VARCHAR2(2000)	    NULL
)
TABLESPACE V8MAIN
    STORAGE (
	INITIAL 64K
	NEXT 1M
	MINEXTENTS 1
	MAXEXTENTS 2147483645
	PCTINCREASE 50 
	FREELISTS 1 FREELIST GROUPS 1
        )
;

ALTER TABLE WMWP ADD (
	CONSTRAINT WMWP_PK
	PRIMARY KEY
	            (
	             WMWP_ID
	            )
	USING INDEX
	TABLESPACE V8INDEX
)
;

/*  WSIG  */
CREATE TABLE WSIG (
	 WSIG_ID	NUMBER(30)	NOT NULL
	,WSIG_YRES_ID	NUMBER(30)	    NULL
	,WSIG_XCMS_ID	NUMBER(30)	    NULL
	,WSIG_DOCUMENT	LONG RAW	    NULL
)
TABLESPACE V8MAIN
    STORAGE (
	INITIAL 64K
	NEXT 1M
	MINEXTENTS 1
	MAXEXTENTS 2147483645
	PCTINCREASE 50 
	FREELISTS 1 FREELIST GROUPS 1
        )
;

ALTER TABLE WSIG ADD (
	CONSTRAINT WSIG_PK
	PRIMARY KEY
	            (
	             WSIG_ID
	            )
	USING INDEX
	TABLESPACE V8INDEX
)
;

/*  WSMC  */
CREATE TABLE WSMC (
	 WSMC_ID	NUMBER(30)	NOT NULL
	,WSMC_WPCA_ID	NUMBER(30)	NOT NULL
	,WSMC_TIMESTAMP	DATE	NOT NULL
	,WSMC_CONFIGXML	CLOB	NOT NULL
)
TABLESPACE V8CONF
    STORAGE (
	INITIAL 64K
	NEXT 1M
	MINEXTENTS 1
	MAXEXTENTS 2147483645
	PCTINCREASE 50 
	FREELISTS 1 FREELIST GROUPS 1
        )
;

ALTER TABLE WSMC ADD (
	CONSTRAINT WSMC_PK
	PRIMARY KEY
	            (
	             WSMC_ID
	            )
	USING INDEX
	TABLESPACE V8INDEX
)
;

/*  WSML  */
CREATE TABLE WSML (
	 WSML_ID	NUMBER(30)	NOT NULL
	,WSML_WPCA_ID	NUMBER(30)	    NULL
	,WSML_TERMINALNAME	VARCHAR2(60)	    NULL
	,WSML_TIMESTAMP	DATE	NOT NULL
	,WSML_TEXT	CLOB	NOT NULL
)
TABLESPACE V8MAIN
    STORAGE (
	INITIAL 64K
	NEXT 1M
	MINEXTENTS 1
	MAXEXTENTS 2147483645
	PCTINCREASE 50 
	FREELISTS 1 FREELIST GROUPS 1
        )
;

ALTER TABLE WSML ADD (
	CONSTRAINT WSML_PK
	PRIMARY KEY
	            (
	             WSML_ID
	            )
	USING INDEX
	TABLESPACE V8INDEX
)
;

/*  XPAD  */
CREATE TABLE XPAD (
	 XPAD_ID	NUMBER(30)	NOT NULL
	,XPAD_TYPE	NUMBER(3)	NOT NULL
)
TABLESPACE V8MAIN
    STORAGE (
	INITIAL 64K
	NEXT 1M
	MINEXTENTS 1
	MAXEXTENTS 2147483645
	PCTINCREASE 50 
	FREELISTS 1 FREELIST GROUPS 1
        )
;

ALTER TABLE XPAD ADD (
	CONSTRAINT XPAD_PK
	PRIMARY KEY
	            (
	             XPAD_ID
	            )
	USING INDEX
	TABLESPACE V8INDEX
)
;

/*  YFOR  */
CREATE TABLE YFOR (
	 YFOR_ID	NUMBER(30)	NOT NULL
	,YFOR_SHORTDESC	VARCHAR2(10)	NOT NULL
	,YFOR_LONGDESC	VARCHAR2(30)	NOT NULL
	,YFOR_FORMULA	VARCHAR2(2000)	NOT NULL
	,YFOR_INACTIVE	NUMBER(1) DEFAULT 0
   	    NULL
	,YFOR_DISPLORDER	VARCHAR2(3)	    NULL
)
TABLESPACE V8CONF
    STORAGE (
	INITIAL 64K
	NEXT 1M
	MINEXTENTS 1
	MAXEXTENTS 2147483645
	PCTINCREASE 50 
	FREELISTS 1 FREELIST GROUPS 1
        )
;

ALTER TABLE YFOR ADD (
	CONSTRAINT YFOR_PK
	PRIMARY KEY
	            (
	             YFOR_ID
	            )
	USING INDEX
	TABLESPACE V8INDEX
)
;

/*  YRDM  */
CREATE TABLE YRDM (
	 YRDM_ID	NUMBER(30)	NOT NULL
	,YRDM_YRDB_ID	NUMBER(30)	NOT NULL
	,YRDM_YCAD_ID	NUMBER(30)	NOT NULL
)
TABLESPACE V8CONF
    STORAGE (
	INITIAL 64K
	NEXT 1M
	MINEXTENTS 1
	MAXEXTENTS 2147483645
	PCTINCREASE 50 
	FREELISTS 1 FREELIST GROUPS 1
        )
;

ALTER TABLE YRDM ADD (
	CONSTRAINT YRDM_PK
	PRIMARY KEY
	            (
	             YRDM_ID
	            )
	USING INDEX
	TABLESPACE V8INDEX
)
;

/*  ZURL  */
CREATE TABLE ZURL (
	 ZURL_ID	NUMBER(30)	NOT NULL
	,ZURL_ZOTA_ID	NUMBER(30)	NOT NULL
	,ZURL_MSG_NAME	VARCHAR2(100)	    NULL
	,ZURL_URL	VARCHAR2(150)	    NULL
	,ZURL_INACTIVE	NUMBER(1)	    NULL
	,ZURL_MSG_TYPE	NUMBER(1)	    NULL
)
TABLESPACE V8MAIN
    STORAGE (
	INITIAL 64K
	NEXT 1M
	MINEXTENTS 1
	MAXEXTENTS 2147483645
	PCTINCREASE 50 
	FREELISTS 1 FREELIST GROUPS 1
        )
;

ALTER TABLE ZURL ADD (
	CONSTRAINT ZURL_PK
	PRIMARY KEY
	            (
	             ZURL_ID
	            )
	USING INDEX
	TABLESPACE V8INDEX
)
;



/************************************************************************************************************************
*
*  The following statements will upgrade the COMMON tables and create new tables
*
************************************************************************************************************************/


ALTER TABLE CORD ADD ( CORD_VOID_ZFAC_ID NUMBER(30) NULL  );

ALTER TABLE CORD ADD ( CORD_CSHP_ID NUMBER(30) NULL  );

ALTER TABLE CORD ADD ( CORD_SENDBYMAIL NUMBER(1) NULL  );

ALTER TABLE CORD ADD ( CORD_SHIP_MULTIPLY NUMBER(1) NULL  );

ALTER TABLE COUP ADD ( COUP_CSHP_ID NUMBER(30) NULL  );

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

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

ALTER TABLE MMOD ADD ( MMOD_FTP_BACKUPPATH VARCHAR2(100) 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 MMOD ADD ( MMOD_FTP_SSL_SESSION_RESUMP NUMBER(1) NULL  );

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

ALTER TABLE SMAN ADD ( SMAN_EARLY_DEP_ROOMS_D NUMBER(5) NULL  );

ALTER TABLE SMAN ADD ( SMAN_EARLY_DEP_ROOMS_M NUMBER(5) NULL  );

ALTER TABLE SMAN ADD ( SMAN_EARLY_DEP_ROOMS_Y NUMBER(7) NULL  );

ALTER TABLE SMAN ADD ( SMAN_EARLY_DEP_ADULTS_D NUMBER(5) NULL  );

ALTER TABLE SMAN ADD ( SMAN_EARLY_DEP_ADULTS_M NUMBER(5) NULL  );

ALTER TABLE SMAN ADD ( SMAN_EARLY_DEP_ADULTS_Y NUMBER(7) NULL  );

ALTER TABLE SMAN ADD ( SMAN_EARLY_DEP_CHILDS_D NUMBER(5) NULL  );

ALTER TABLE SMAN ADD ( SMAN_EARLY_DEP_CHILDS_M NUMBER(5) NULL  );

ALTER TABLE SMAN ADD ( SMAN_EARLY_DEP_CHILDS_Y NUMBER(7) NULL  );

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

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

ALTER TABLE WFPP ADD ( WFPP_PICTURE_C_CLOB CLOB NULL  );

ALTER TABLE WPCA ADD ( WPCA_IS_S8_KIOSK NUMBER(1) NULL  );

ALTER TABLE WPCA ADD ( WPCA_KIOSK_ZFST_ID NUMBER(30) NULL  );

ALTER TABLE WPHS MODIFY ( WPHS_VPDID VARCHAR2(30) );

ALTER TABLE WPPP MODIFY ( WPPP_LONGDESC VARCHAR2(60) );

ALTER TABLE WQNR ADD ( WQNR_HOLIDAYCHECK NUMBER(1) NULL  );

ALTER TABLE WQUE MODIFY ( WQUE_QUESTIONTEXT VARCHAR2(2000) );

ALTER TABLE WQUE MODIFY ( WQUE_DESCRIPTION VARCHAR2(2000) );

ALTER TABLE WRPB ADD ( WRPB_NONBINARYREPORTID NUMBER(30) NULL  );

ALTER TABLE WSPS MODIFY ( WSPS_VPDID VARCHAR2(30) );

ALTER TABLE WSQP ADD ( WSQP_INCLUDEPARAM NUMBER(1) NULL  );

ALTER TABLE WSQP ADD ( WSQP_MULTISELECT NUMBER(1) DEFAULT 1 NOT NULL  );

ALTER TABLE XCED ADD ( XCED_WAITER_ID CHAR(12) NULL  );

ALTER TABLE XCMG MODIFY ( XCMG_GLOBALID VARCHAR2(100) );

ALTER TABLE XCMS ADD ( XCMS_CENTRALCORRESPONDENCE NUMBER(1) DEFAULT 0 NOT NULL  );

ALTER TABLE XCNC ADD ( XCNC_POPUP_TABLERESERVATION NUMBER(1) NULL  );

ALTER TABLE XDLT ADD ( XDLT_XPAD_ID NUMBER(30) NULL  );

ALTER TABLE XMTY ADD ( XMTY_CENTRAL NUMBER(1) DEFAULT 0 NOT NULL  );

ALTER TABLE YBOS ADD ( YBOS_GROSSUNITPRICE NUMBER(30,4) NULL  );

ALTER TABLE YBSS ADD ( YBSS_GROSSUNITPRICE NUMBER(30,4) NULL  );

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

ALTER TABLE YFBK MODIFY ( YFBK_ACCESSTOKEN VARCHAR2(400) );

ALTER TABLE YGRP ADD ( YGRP_FIXEXCHRATE NUMBER(1) NULL  );

ALTER TABLE YHKS ADD ( YHKS_GREENSTATUS NUMBER(1) NULL  );

ALTER TABLE YHKS ADD ( YHKS_GREENSTATUSDAYS NUMBER(1) NULL  );

ALTER TABLE YRCO ADD ( YRCO_TYPE NUMBER(1) NULL  );

ALTER TABLE YRDC ADD ( YRDC_YCAD_ID NUMBER(30) DEFAULT 0 NOT NULL  );

ALTER TABLE YRES ADD ( YRES_CENTRALCORRESPONDENCE NUMBER(1) DEFAULT 0 NOT NULL  );

ALTER TABLE ZALL ADD ( ZALL_PROFORMA NUMBER(1) DEFAULT 0 NULL  );

ALTER TABLE ZARR ADD ( ZARR_CENTRAL NUMBER(1) DEFAULT 0 NOT NULL  );

ALTER TABLE ZDCG ADD ( ZDCG_CENTRAL NUMBER(1) DEFAULT 0 NOT NULL  );

ALTER TABLE ZDCO ADD ( ZDCO_CENTRAL NUMBER(1) DEFAULT 0 NOT NULL  );

ALTER TABLE ZDMG ADD ( ZDMG_CENTRAL NUMBER(1) DEFAULT 0 NOT NULL  );

ALTER TABLE ZOTA ADD ( ZOTA_UPLOAD_ONLY_DEFAULT_RATE NUMBER(1) DEFAULT 0 NULL  );

ALTER TABLE WFMC ADD WFMC_ANCESTOR_VERSIONID VARCHAR2(30);

CREATE TABLE YCWI (
    YCWI_ID NUMBER(30) NOT NULL
   ,YCWI_WEBENABLED NUMBER(1)
   ,YCWI_SHORTWEBINFO VARCHAR2(2000)
   ,YCWI_LONGWEBINFO VARCHAR2(2000)
   ,CONSTRAINT YCWI_PK PRIMARY KEY (YCWI_ID) USING INDEX TABLESPACE V8INDEX) TABLESPACE V8MAIN;
   
CREATE SEQUENCE SEQ_YCWI INCREMENT BY 1 START WITH 1000 NOMAXVALUE NOCYCLE NOCACHE NOORDER;

COMMENT ON TABLE YCWI is 'Web info';

COMMENT ON COLUMN YCWI.YCWI_WEBENABLED IS '0 - not enabled for web; 1 - enabled for web';

COMMENT ON COLUMN YCWI.YCWI_SHORTWEBINFO IS 'Short web info';

COMMENT ON COLUMN YCWI.YCWI_LONGWEBINFO IS 'Long web info';

ALTER TABLE YFSC ADD YFSC_YCWI_ID NUMBER(30);

COMMENT ON COLUMN YFSC.YFSC_YCWI_ID IS 'Extends function space definition with a config for web';

ALTER TABLE YSSL ADD YSSL_YCWI_ID NUMBER(30);

COMMENT ON COLUMN YSSL.YSSL_YCWI_ID IS 'Extends function space seating with a config for web';

ALTER TABLE YFSR ADD YFSR_YCWI_ID NUMBER(30);

COMMENT ON COLUMN YFSR.YFSR_YCWI_ID IS 'Extends function space rate with a config for web';

ALTER TABLE YCIT ADD YCIT_YCWI_ID NUMBER(30);

COMMENT ON COLUMN YCIT.YCIT_YCWI_ID IS 'Extends Catering item definition with a config for web';

ALTER TABLE YCIR ADD YCIR_YCWI_ID NUMBER(30);

COMMENT ON COLUMN YCIR.YCIR_YCWI_ID IS 'Extends Catering item rate with a config for web';

ALTER TABLE YSME ADD YSME_YCWI_ID NUMBER(30);

COMMENT ON COLUMN YSME.YSME_YCWI_ID IS 'Extends Standard menue with a config for web';

ALTER TABLE YSMR ADD YSMR_YCWI_ID NUMBER(30);

COMMENT ON COLUMN YSMR.YSMR_YCWI_ID IS 'Extends Standard menue rates with a config for web';

ALTER TABLE YCMI ADD YCMI_YCWI_ID NUMBER(30);

COMMENT ON COLUMN YCMI.YCMI_YCWI_ID IS 'Extends Menu item with a config for web';

ALTER TABLE YCMR ADD YCMR_YCWI_ID NUMBER(30);

COMMENT ON COLUMN YCMR.YCMR_YCWI_ID IS 'Extends Menu item rates with a config for web';

CREATE TABLE YWRA (
    YWRA_ID NUMBER(30) NOT NULL
   ,YWRA_YFSC_ID NUMBER(30) NOT NULL
   ,YWRA_YETY_ID NUMBER(30) NOT NULL
   ,CONSTRAINT YWRA_PK PRIMARY KEY (YWRA_ID) USING INDEX TABLESPACE V8INDEX) TABLESPACE V8MAIN;

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

COMMENT ON TABLE YWRA IS 'Web restriction Event type - Function Spaces';

COMMENT ON COLUMN YWRA.YWRA_YFSC_ID IS 'Function Space restricted';

COMMENT ON COLUMN YWRA.YWRA_YETY_ID IS 'Event type ID';

CREATE TABLE YWRB (
    YWRB_ID NUMBER(30) NOT NULL
   ,YWRB_YFSC_ID NUMBER(30) NOT NULL
   ,YWRB_YSSC_ID NUMBER(30) NOT NULL
   ,CONSTRAINT YWRB_PK PRIMARY KEY (YWRB_ID) USING INDEX TABLESPACE V8INDEX) TABLESPACE V8MAIN;

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

COMMENT ON TABLE YWRB IS 'Web restriction Seattings - Function Spaces';

COMMENT ON COLUMN YWRB.YWRB_YFSC_ID IS 'Function Space restricted';

COMMENT ON COLUMN YWRB.YWRB_YSSC_ID IS 'Seating ID';

CREATE TABLE YWRC (
    YWRC_ID NUMBER(30) NOT NULL
   ,YWRC_YFSC_ID NUMBER(30) NOT NULL
   ,YWRC_YCAD_ID NUMBER(30) NOT NULL
   ,CONSTRAINT YWRC_PK PRIMARY KEY (YWRC_ID) USING INDEX TABLESPACE V8INDEX) TABLESPACE V8MAIN;

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

COMMENT ON TABLE YWRC IS 'Web restriction Hotel Segment - Function Spaces';

COMMENT ON COLUMN YWRC.YWRC_YFSC_ID IS 'Function Space restricted';

COMMENT ON COLUMN YWRC.YWRC_YCAD_ID IS 'Hotel Segment ID';

CREATE TABLE YWRD (
    YWRD_ID NUMBER(30) NOT NULL
   ,YWRD_YFSC_ID NUMBER(30) NOT NULL
   ,YWRD_YPKG_ID NUMBER(30) NOT NULL
   ,CONSTRAINT YWRD_PK PRIMARY KEY (YWRD_ID) USING INDEX TABLESPACE V8INDEX) TABLESPACE V8MAIN;

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

COMMENT ON TABLE YWRD IS 'Web restriction Packages - Function Spaces';

COMMENT ON COLUMN YWRD.YWRD_YFSC_ID IS 'Function Space restricted';

COMMENT ON COLUMN YWRD.YWRD_YPKG_ID IS 'Package ID';

ALTER TABLE YPKG ADD YPKG_YCWI_ID NUMBER(30);

COMMENT ON COLUMN YPKG.YPKG_YCWI_ID IS 'Linked to web config';

ALTER TABLE YETY ADD YETY_YCWI_ID NUMBER(30);

COMMENT ON COLUMN YETY.YETY_YCWI_ID IS 'Linked to web config';

ALTER TABLE MDEF MODIFY MDEF_TYPE VARCHAR2(3);

ALTER TABLE YFTY ADD YFTY_YCWI_ID NUMBER(30);

COMMENT ON COLUMN YFTY.YFTY_YCWI_ID IS 'Linked to web info';



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


/*  WSQP  */

CREATE INDEX WSQP_DISPLORDER ON WSQP
	(
	  WSQP_DISPLORDER
	)
	TABLESPACE V8INDEX
;
CREATE INDEX WSQP_WSQL_ID ON WSQP
	(
	  WSQP_WSQL_ID
	)
	TABLESPACE V8INDEX
;



/*  XCMG  */
CREATE INDEX XCMG_XCMS_ID ON XCMG
	(
	  XCMG_XCMS_ID
	)
	TABLESPACE V8INDEX
;


/*  YRAV  */

CREATE INDEX YRAV_MAXVALUE ON YRAV
	(
	  YRAV_MAXVALUE
	)
	TABLESPACE V8INDEX
;
CREATE INDEX YRAV_TYPE ON YRAV
	(
	  YRAV_TYPE
	)
	TABLESPACE V8INDEX
;
CREATE INDEX YRAV_VALUE ON YRAV
	(
	  YRAV_VALUE
	)
	TABLESPACE V8INDEX
;


/*  YRPI  */

CREATE INDEX YRPI_ENDDATE ON YRPI
	(
	  YRPI_ENDDATE
	)
	TABLESPACE V8INDEX
;
CREATE INDEX YRPI_STARTDATE ON YRPI
	(
	  YRPI_STARTDATE
	)
	TABLESPACE V8INDEX
;



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


ALTER TABLE WSQP ADD (
	CONSTRAINT WSQP_PK
	PRIMARY KEY
	            (
	             WSQP_ID
	            )
	USING INDEX
	TABLESPACE V8INDEX
)
;



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


insert into wusr 
select seq_wusr.nextval,wusr_xcms_id,wusr_wegr_id,'ConfigurationGlobal settings',wusr_value 
from wusr w 
where wusr_name='ConfigurationMiscellaneous' 
and not exists (
   select 1 
   from wusr ww 
   where (ww.wusr_xcms_id=w.wusr_xcms_id or ww.wusr_wegr_id=w.wusr_wegr_id)
   and ww.wusr_name='ConfigurationGlobal settings'
   );  

commit;
 

UPDATE MAVL SET MAVL_UPLOAD_RATE = 1, MAVL_UPLOAD_RAVL = 1;




 
--- End of DBDiff for Oracle --- Elapsed Time: 00:29:16 ---




