--THIS FILE IS NEEDED ONLY FOR THE ONLINE UPDATE!!!

/************************************************************************************************************************
*
*
*  Date: October 10, 2006  22:34:12
*
*  This upgrade script was automatically generated by DBDiff for Oracle (www.dbdiff.com)
*
*  SOURCE DATABASE:  VERSION_8_6_1_0@V8
*  TARGET DATABASE:  VERSION_8_6_0_6@V8
*
*  This script should be executed as VERSION_8_6_0_6 in database VERSION_8_6_0_6@V8 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_RDAY INCREMENT BY 1 START WITH 1000 NOMAXVALUE MINVALUE 1 NOCYCLE NOCACHE NOORDER;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


/************************************************************************************************************************
*
*  tables
*
*  571 tables were found in VERSION_8_6_1_0@V8
*  555 tables were found in VERSION_8_6_0_6@V8
*
************************************************************************************************************************/




/************************************************************************************************************************
*
*  The following statements will drop tables that DO NOT exist in VERSION_8_6_1_0@V8
*
************************************************************************************************************************/


DROP TABLE VERSION_8_6_0_11;


/************************************************************************************************************************
*
*  The following statements will create tables that DO NOT exist in VERSION_8_6_0_6@V8
*
************************************************************************************************************************/


/*  RDAY  */
CREATE TABLE RDAY (
	 RDAY_ID	NUMBER(30)	NOT NULL
	,RDAY_RRST_ID	NUMBER(30)	NOT NULL
	,RDAY_STARTDATE	DATE	NOT NULL
	,RDAY_ENDDATE	DATE	NOT NULL
	,RDAY_MESSAGE	VARCHAR2(1000)	NOT NULL
	,RDAY_USER_XCMS_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 RDAY ADD (
	CONSTRAINT RDAY_PK
	PRIMARY KEY
	            (
	             RDAY_ID
	            )
	USING INDEX
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
)
;

/*  RDET  */
CREATE TABLE RDET (
	 RDET_ID	NUMBER(30)	NOT NULL
	,RDET_RRES_ID	NUMBER(30)	NOT NULL
	,RDET_RTAB_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 RDET ADD (
	CONSTRAINT RDET_PK
	PRIMARY KEY
	            (
	             RDET_ID
	            )
	USING INDEX
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
)
;

/*  ROTM  */
CREATE TABLE ROTM (
	 ROTM_ID	NUMBER(30)	NOT NULL
	,ROTM_STARTDATE	DATE	NOT NULL
	,ROTM_ENDDATE	DATE	NOT NULL
	,ROTM_RRST_ID	NUMBER(30)	NOT 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 ROTM ADD (
	CONSTRAINT ROTM_PK
	PRIMARY KEY
	            (
	             ROTM_ID
	            )
	USING INDEX
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
)
;

/*  RRES  */
CREATE TABLE RRES (
	 RRES_ID	NUMBER(30)	NOT NULL
	,RRES_DATE	DATE	NOT NULL
	,RRES_STARTTIME	DATE	NOT NULL
	,RRES_ENDTIME	DATE	NOT NULL
	,RRES_PAX	NUMBER(3)	    NULL
	,RRES_RRST_ID	NUMBER(30)	NOT NULL
	,RRES_XCMS_ID	NUMBER(30)	NOT NULL
	,RRES_DESCRIPTION	VARCHAR2(128)	    NULL
	,RRES_WCOL_ID	NUMBER(30)	    NULL
	,RRES_CANCELED	NUMBER(1)	    NULL
	,RRES_TABLECARD	VARCHAR2(2000)	    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 RRES ADD (
	CONSTRAINT RRES_PK
	PRIMARY KEY
	            (
	             RRES_ID
	            )
	USING INDEX
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
)
;

/*  RRGL  */
CREATE TABLE RRGL (
	 RRGL_ID	NUMBER(30)	NOT NULL
	,RRGL_RRES_ID	NUMBER(30)	NOT NULL
	,RRGL_XCAC_ID	NUMBER(30)	NOT NULL
	,RRGL_NUMBER	NUMBER(3)	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 RRGL ADD (
	CONSTRAINT RRGL_PK
	PRIMARY KEY
	            (
	             RRGL_ID
	            )
	USING INDEX
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
)
;

/*  RRST  */
CREATE TABLE RRST (
	 RRST_ID	NUMBER(30)	NOT NULL
	,RRST_SHORTDESC	VARCHAR2(3)	NOT NULL
	,RRST_NAME	VARCHAR2(30)	NOT NULL
	,RRST_DEF_DURATION	NUMBER(3)	    NULL
	,RRST_SETUP_TIME	NUMBER(3)	    NULL
	,RRST_DISPLORDER	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 RRST ADD (
	CONSTRAINT RRST_PK
	PRIMARY KEY
	            (
	             RRST_ID
	            )
	USING INDEX
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
)
;

/*  RSTF  */
CREATE TABLE RSTF (
	 RSTF_ID	NUMBER(30)	NOT NULL
	,RSTF_RTFR_ID	NUMBER(30)	NOT NULL
	,RSTF_START	DATE	NOT NULL
	,RSTF_END	DATE	NOT 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 RSTF ADD (
	CONSTRAINT RSTF_PK
	PRIMARY KEY
	            (
	             RSTF_ID
	            )
	USING INDEX
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
)
;

/*  RTAB  */
CREATE TABLE RTAB (
	 RTAB_ID	NUMBER(30)	NOT NULL
	,RTAB_RRST_ID	NUMBER(30)	NOT NULL
	,RTAB_NUMBER	NUMBER(3)	NOT NULL
	,RTAB_DESCRIPTION	VARCHAR2(30)	    NULL
	,RTAB_STD_PAX	NUMBER(2)	NOT NULL
	,RTAB_MAX_PAX	NUMBER(2)	NOT NULL
	,RTAB_DISPLORDER	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 RTAB ADD (
	CONSTRAINT RTAB_PK
	PRIMARY KEY
	            (
	             RTAB_ID
	            )
	USING INDEX
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
)
;

/*  RTAT  */
CREATE TABLE RTAT (
	 RTAT_ID	NUMBER(30)	NOT NULL
	,RTAT_XPAC_ID	NUMBER(30)	NOT NULL
	,RTAT_XPDA_ID	NUMBER(30)	NOT NULL
	,RTAT_RTAB_ID	NUMBER(30)	NOT 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 RTAT ADD (
	CONSTRAINT RTAT_PK
	PRIMARY KEY
	            (
	             RTAT_ID
	            )
	USING INDEX
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
)
;

/*  RTFR  */
CREATE TABLE RTFR (
	 RTFR_ID	NUMBER(30)	NOT NULL
	,RTFR_ROTM_ID	NUMBER	NOT NULL
	,RTFR_STARTTIME	DATE	NOT NULL
	,RTFR_ENDTIME	DATE	NOT 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 RTFR ADD (
	CONSTRAINT RTFR_PK
	PRIMARY KEY
	            (
	             RTFR_ID
	            )
	USING INDEX
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
)
;

/*  RTLN  */
CREATE TABLE RTLN (
	 RTLN_ID	NUMBER(30)	NOT NULL
	,RTLN_MASTER_RTAB_ID	NUMBER(30)	NOT NULL
	,RTLN_LINKED_RTAB_ID	NUMBER(30)	NOT 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 RTLN ADD (
	CONSTRAINT RTLN_PK
	PRIMARY KEY
	            (
	             RTLN_ID
	            )
	USING INDEX
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
)
;

ALTER TABLE RDAY ADD (
	CONSTRAINT RDAY_RRST_ID
	FOREIGN KEY
	            (
	             RDAY_RRST_ID
	            )
	REFERENCES RRST
	            (
	             RRST_ID
	            )
)
;

ALTER TABLE RDET ADD (
	CONSTRAINT RDET_RRES_ID
	FOREIGN KEY
	            (
	             RDET_RRES_ID
	            )
	REFERENCES RRES
	            (
	             RRES_ID
	            )
)
;

ALTER TABLE RDET ADD (
	CONSTRAINT RDET_RTAB_ID
	FOREIGN KEY
	            (
	             RDET_RTAB_ID
	            )
	REFERENCES RTAB
	            (
	             RTAB_ID
	            )
)
;

ALTER TABLE ROTM ADD (
	CONSTRAINT ROTM_RRST_ID
	FOREIGN KEY
	            (
	             ROTM_RRST_ID
	            )
	REFERENCES RRST
	            (
	             RRST_ID
	            )
)
;

ALTER TABLE RRES ADD (
	CONSTRAINT RRES_RRST_ID
	FOREIGN KEY
	            (
	             RRES_RRST_ID
	            )
	REFERENCES RRST
	            (
	             RRST_ID
	            )
)
;

ALTER TABLE RRES ADD (
	CONSTRAINT RRES_XCMS_ID
	FOREIGN KEY
	            (
	             RRES_XCMS_ID
	            )
	REFERENCES XCMS
	            (
	             XCMS_ID
	            )
)
;

ALTER TABLE RSTF ADD (
	CONSTRAINT RSTF_RTFR_ID
	FOREIGN KEY
	            (
	             RSTF_RTFR_ID
	            )
	REFERENCES RTFR
	            (
	             RTFR_ID
	            )
)
;

ALTER TABLE RTAB ADD (
	CONSTRAINT RTAB_RRST_ID
	FOREIGN KEY
	            (
	             RTAB_RRST_ID
	            )
	REFERENCES RRST
	            (
	             RRST_ID
	            )
)
;

ALTER TABLE RTAT ADD (
	CONSTRAINT RTAT_RTAB_ID
	FOREIGN KEY
	            (
	             RTAT_RTAB_ID
	            )
	REFERENCES RTAB
	            (
	             RTAB_ID
	            )
)
;

ALTER TABLE RTFR ADD (
	CONSTRAINT RTFR_ROTM_ID
	FOREIGN KEY
	            (
	             RTFR_ROTM_ID
	            )
	REFERENCES ROTM
	            (
	             ROTM_ID
	            )
)
;

ALTER TABLE RTLN ADD (
	CONSTRAINT RTLN_LINKED_RTAB_ID
	FOREIGN KEY
	            (
	             RTLN_LINKED_RTAB_ID
	            )
	REFERENCES RTAB
	            (
	             RTAB_ID
	            )
)
;

ALTER TABLE RTLN ADD (
	CONSTRAINT RTLN_MASTER_RTAB_ID
	FOREIGN KEY
	            (
	             RTLN_MASTER_RTAB_ID
	            )
	REFERENCES RTAB
	            (
	             RTAB_ID
	            )
)
;

/*  VERSION_8_6_1_0  */
CREATE TABLE VERSION_8_6_1_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
        )
;


/*  YHSL  */
CREATE TABLE YHSL (
	 YHSL_ID	NUMBER(30)	NOT NULL
	,YHSL_YHAT_ID	NUMBER(30)	NOT NULL
	,YHSL_YSRL_ID	NUMBER(30)	    NULL
	,YHSL_YRMS_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 YHSL ADD (
	CONSTRAINT YHSL_PK
	PRIMARY KEY
	            (
	             YHSL_ID
	            )
	USING INDEX
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
)
;

/*  YRRC  */
CREATE TABLE YRRC (
	 YRRC_ID	NUMBER	NOT NULL
	,YRRC_YRES_ID	NUMBER	    NULL
	,YRRC_XCMS_ID	NUMBER	    NULL
	,YRRC_REGCARDNUMBER	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
        )
;

ALTER TABLE YRRC ADD (
	CONSTRAINT YRRC_PK
	PRIMARY KEY
	            (
	             YRRC_ID
	            )
	USING INDEX
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
)
;

/*  ZDGT  */
CREATE TABLE ZDGT (
	 ZDGT_ID	NUMBER(30)	NOT NULL
	,ZDGT_SHORTDESC	VARCHAR2(3)	NOT NULL
	,ZDGT_LONGDESC	VARCHAR2(30)	NOT NULL
	,ZDGT_TYPE	NUMBER(2)	NOT 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 ZDGT ADD (
	CONSTRAINT ZDGT_PK
	PRIMARY KEY
	            (
	             ZDGT_ID
	            )
	USING INDEX
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
)
;

/*  ZFTT  */
CREATE TABLE ZFTT (
	 ZFTT_ID	NUMBER(30)	NOT NULL
	,ZFTT_ZFAC_ID	NUMBER(30)	NOT NULL
	,ZFTT_TIMESTAMP	DATE	    NULL
	,ZFTT_TYPE	NUMBER(1)	    NULL
	,ZFTT_USER_XCMS_ID	NUMBER(30)	    NULL
	,ZFTT_ZDGT_ID	NUMBER(30)	    NULL
	,ZFTT_MFD_TICKET_POSTYPE	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 ZFTT ADD (
	CONSTRAINT ZFTT_PK
	PRIMARY KEY
	            (
	             ZFTT_ID
	            )
	USING INDEX
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
)
;

CREATE INDEX ZFTT_MFD_TICKET_POSTYPE ON ZFTT
	(
	  ZFTT_MFD_TICKET_POSTYPE
	)
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
;

CREATE INDEX ZFTT_TIMESTAMP ON ZFTT
	(
	  ZFTT_TIMESTAMP
	)
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
;

CREATE INDEX ZFTT_TYPE ON ZFTT
	(
	  ZFTT_TYPE
	)
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
;

/*  ZFZP  */
CREATE TABLE ZFZP (
	 ZFZP_ID	NUMBER(30)	NOT NULL
	,ZFZP_ZFAC_ID	NUMBER(30)	NOT NULL
	,ZFZP_XCOU_ID	NUMBER(30)	NOT NULL
	,ZFZP_ZIP	VARCHAR2(15)	    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 ZFZP ADD (
	CONSTRAINT ZFZP_PK
	PRIMARY KEY
	            (
	             ZFZP_ID
	            )
	USING INDEX
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
)
;

/*  ZRDF  */
CREATE TABLE ZRDF (
	 ZRDF_ID	NUMBER(30)	NOT NULL
	,ZRDF_SHORTDESC	VARCHAR2(3)	NOT NULL
	,ZRDF_LONGDESC	VARCHAR2(30)	NOT NULL
	,ZRDF_INACTIVE	NUMBER(1)	    NOT NULL
	,ZRDF_DISPLORDER	NUMBER(4)	    NOT NULL
	,ZRDF_FROMTIME	DATE	    NULL
	,ZRDF_UNTILTIME	DATE	    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 ZRDF ADD (
	CONSTRAINT ZRDF_PK
	PRIMARY KEY
	            (
	             ZRDF_ID
	            )
	USING INDEX
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
)
;

/*  ZRDL  */
CREATE TABLE ZRDL (
	 ZRDL_ID	NUMBER(30)	NOT NULL
	,ZRDL_YRES_ID	NUMBER(30)	NULL
	,ZRDL_ZFAC_ID	NUMBER(30)	NULL
	,ZRDL_ZRDF_ID	NUMBER(30)	    NOT NULL
	,ZRDL_INACTIVE	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 ZRDL ADD (
	CONSTRAINT ZRDL_PK
	PRIMARY KEY
	            (
	             ZRDL_ID
	            )
	USING INDEX
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
)
;

CREATE INDEX ZRDL_YRES_ID ON ZRDL
	(
	  ZRDL_YRES_ID
	)
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
;

CREATE INDEX ZRDL_ZFAC_ID ON ZRDL
	(
	  ZRDL_ZFAC_ID
	)
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
;

CREATE INDEX ZRDL_ZRDF_ID ON ZRDL
	(
	  ZRDL_ZRDF_ID
	)
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
;

/*  ZRDP  */
CREATE TABLE ZRDP (
	 ZRDP_ID	NUMBER(30)	NOT NULL
	,ZRDP_REBATED_ZPOS_ID	NUMBER(30)	NOT NULL
	,ZRDP_REBATING_ZPOS_ID	NUMBER(30)	NOT NULL
	,ZRDP_ZRDF_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 ZRDP ADD (
	CONSTRAINT ZRDP_PK
	PRIMARY KEY
	            (
	             ZRDP_ID
	            )
	USING INDEX
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
)
;

CREATE INDEX ZRDP_REBATED_ZPOS_ID ON ZRDP
	(
	  ZRDP_REBATED_ZPOS_ID
	)
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
;

CREATE INDEX ZRDP_REBATING_ZPOS_ID ON ZRDP
	(
	  ZRDP_REBATING_ZPOS_ID
	)
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
;

CREATE INDEX ZRDP_ZRDF_ID ON ZRDP
	(
	  ZRDP_ZRDF_ID
	)
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
;


/*  MMAP  */
CREATE TABLE MMAP (
	 MMAP_ID NUMBER(30) NOT NULL
	,MMAP_MMOD_ID NUMBER(30) NOT NULL
	,MMAP_CRS_ITEM_NAME VARCHAR2(200) NULL
	,MMAP_CRS_ITEM_POS NUMBER(3) NULL
	,MMAP_FIELD_NAME VARCHAR2(100) NULL
	,MMAP_TABLE_NAME VARCHAR2(4) NULL
	,MMAP_FIELD_SIZE NUMBER(3) NULL
	,MMAP_FIELD_SCALE NUMBER(1) NULL
	,MMAP_FIELD_TYPE NUMBER(1) NULL
	,MMAP_DESCRIPTION VARCHAR2(100) NULL
	,MMAP_ISATTRIBUTE NUMBER(1) NULL
	,MMAP_RECORD_TYPE NUMBER(2) 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 MMAP ADD (
	CONSTRAINT MMAP_PK
	PRIMARY KEY
	            (
	             MMAP_ID
	            )
	USING INDEX
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
)
;

CREATE INDEX MMAP_MMOD_ID ON MMAP
	(
	  MMAP_MMOD_ID
	)
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
;


/*  YOUT  */
CREATE TABLE YOUT (
	 YOUT_ID NUMBER(30) NOT NULL
	,YOUT_SHORTDESC VARCHAR(3) NOT NULL
	,YOUT_LONGDESC VARCHAR(30) NOT NULL
	,YOUT_MC_ID NUMBER(30) NULL
	,YOUT_INACTIVE 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 YOUT ADD (
	CONSTRAINT YOUT_PK
	PRIMARY KEY
	            (
	             YOUT_ID
	            )
	USING INDEX
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
)
;


/*  YRBR  */
CREATE TABLE YRBR (
	 YRBR_ID NUMBER(30) NOT NULL
	,YRBR_ORG_YCAT_ID NUMBER(30) NOT NULL
	,YRBR_BORROW_YCAT_ID NUMBER(30) NOT 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 YRBR ADD (
	CONSTRAINT YRBR_PK
	PRIMARY KEY
	            (
	             YRBR_ID
	            )
	USING INDEX
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
)
;

CREATE INDEX YRBR_ORG_YCAT_ID ON YRBR
	(
	  YRBR_ORG_YCAT_ID
	)
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
;

CREATE INDEX YRBR_BORROW_YCAT_ID ON YRBR
	(
	  YRBR_BORROW_YCAT_ID
	)
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
;


/*  YCRF  */
CREATE TABLE YCRF (
	 YCRF_ID NUMBER(30) NOT NULL
	,YCRF_XCAP_ID NUMBER(30) NOT NULL
	,YCRF_CROSSREF_1 VARCHAR2(50) NULL
	,YCRF_CROSSREF_2 VARCHAR2(50) NULL
	,YCRF_CROSSREF_3 VARCHAR2(50) NULL
	,YCRF_CROSSREF_4 VARCHAR2(50) NULL
	,YCRF_CROSSREF_5 VARCHAR2(50) NULL
	,YCRF_CROSSREF_6 VARCHAR2(50) NULL
	,YCRF_CROSSREF_7 VARCHAR2(50) NULL
	,YCRF_CROSSREF_8 VARCHAR2(50) NULL
	,YCRF_CROSSREF_9 VARCHAR2(50) 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 YCRF ADD (
	CONSTRAINT YCRF_PK
	PRIMARY KEY
	            (
	             YCRF_ID
	            )
	USING INDEX
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
)
;

CREATE INDEX YCRF_XCAP_ID ON YCRF
	(
	  YCRF_XCAP_ID
	)
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
;


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


ALTER TABLE MCFG ADD ( MCFG_HTTP_STATUS_INTERVAL NUMBER(5) NULL  );

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

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

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

ALTER TABLE MMOD ADD ( MMOD_HTTP_STATUS_PROXYUSER VARCHAR2(30) NULL  );

ALTER TABLE MMOD ADD ( MMOD_HTTP_STATUS_PROXYPWD VARCHAR2(30) NULL  );

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

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

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

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

ALTER TABLE WRPL ADD ( WRPL_PRINTFINISHEDTIME DATE NULL  );

ALTER TABLE XCLR ADD ( XCLR_TYPE NUMBER(3) NULL  );

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

ALTER TABLE XPAC ADD ( XPAC_TABLERESERVATION NUMBER(1) NULL  );

ALTER TABLE XPRM ADD ( XPRM_RTAB_ID NUMBER(30) NULL  );

ALTER TABLE XPRM ADD ( XPRM_RRST_ID NUMBER(30) NULL  );

ALTER TABLE YCEV MODIFY ( YCEV_LONGDESC VARCHAR2(60)  );

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

ALTER TABLE YGCO ADD ( YGCO_WCOL_ID NUMBER(30) NULL  );

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

ALTER TABLE YRES ADD ( YRES_DESIRED_YRMS_ID NUMBER(30) NULL  );

ALTER TABLE YRES ADD ( YRES_ALLOWANCE_ZFAC_ID NUMBER(30) NULL  );

ALTER TABLE YRES ADD ( YRES_DESIRED_YCAT_ID NUMBER(30) NULL  );

ALTER TABLE YRES ADD ( YRES_ZTXX_ID NUMBER(30) NULL  );

ALTER TABLE YRMS ADD ( YRMS_CLEANCREDITS NUMBER(3) NULL  );

ALTER TABLE YTRD ADD ( YTRD_DEFADULTNO NUMBER(10) NULL  );

ALTER TABLE YTRD ADD ( YTRD_TENTADULTNO NUMBER(10) NULL  );

ALTER TABLE YTRD ADD ( YTRD_DEFCHILDNO NUMBER(10) NULL  );

ALTER TABLE YTRD ADD ( YTRD_TENTCHILDNO NUMBER(10) NULL  );

ALTER TABLE YTRD ADD ( YTRD_DEFCHILDNODOMESTIC NUMBER(10) NULL  );

ALTER TABLE YTRD ADD ( YTRD_TENTCHILDNODOMESTIC NUMBER(10) NULL  );

ALTER TABLE ZDCO ADD ( ZDCO_HOSTESSENABLED NUMBER(1) NULL  );

ALTER TABLE ZDMP ADD ( ZDMP_ZDGT_ID NUMBER(30) NULL  );

ALTER TABLE ZDMP ADD ( ZDMP_DISPLORDER NUMBER(5) NULL  );

ALTER TABLE ZDMP ADD ( ZDMP_INACTIVE NUMBER(1) DEFAULT 0 NOT NULL  );

ALTER TABLE ZFAC ADD ( ZFAC_SOURCE_YRAS_ID NUMBER(30) NULL  );

ALTER TABLE ZFAC ADD ( ZFAC_CHANNEL_YRAS_ID NUMBER(30) NULL  );

ALTER TABLE ZRCC ADD ( ZRCC_EXPIRYATENDOFCALENDARUNIT NUMBER(1) NULL  );

ALTER TABLE ZTAA ADD ( ZTAA_SECONDARY_VALUE NUMBER(30,4) NULL  );

ALTER TABLE ZTAK ADD ( ZTAK_SECONDARY_VALUE NUMBER(30,4) NULL  );

ALTER TABLE ZTSA ADD ( ZTSA_SECONDARY_ZDCO_ID NUMBER(30) NULL  );

ALTER TABLE ZTSA ADD ( ZTSA_SECONDARY_MASTER_ZDCO_ID NUMBER(30) NULL  );

ALTER TABLE ZRCR ADD ( ZRCR_ZRDF_ID NUMBER(30) NULL  );

ALTER TABLE ZRCR ADD ( ZRCR_FLATAMOUNT NUMBER(30,4) NULL  ) ;
 
ALTER TABLE ZRCR MODIFY ( ZRCR_XMTY_ID NULL  );

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

ALTER TABLE ZFAG ADD ( ZFAG_AUTOCHECKOUT_ZDCO_ID NUMBER (30,4) NULL  );

ALTER TABLE WPCA ADD ( WPCA_LOGOFFTIME NUMBER(4) NULL  );

ALTER TABLE XCID ADD ( XCID_FAM_ADDRGREET VARCHAR2(30) NULL  );

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

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

ALTER TABLE XCAG ADD ( XCAG_FAMILY NUMBER(1) NULL  );

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

ALTER TABLE XPDC ADD ( XPDC_BIRTHPLACE VARCHAR2(30) NULL  );

ALTER TABLE WSPS ADD ( WSPS_DISABLED NUMBER(1) NULL  );

ALTER TABLE ZCCA ADD ( ZCCA_CHIP_PIN NUMBER(1) NULL  );

ALTER TABLE SMAN ADD ( SMAN_CHILDS_G1_D NUMBER(6) NULL  );

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

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

ALTER TABLE SMAN ADD ( SMAN_CHILDS_G1_M NUMBER(6) NULL  );

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

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

ALTER TABLE SMAN ADD ( SMAN_CHILDS_G1_Y NUMBER(6) NULL  );

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

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

ALTER TABLE SMAN ADD ( SMAN_DOMESTICCHILDS_G1_D NUMBER(6) NULL  );

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

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

ALTER TABLE SMAN ADD ( SMAN_DOMESTICCHILDS_G1_M NUMBER(6) NULL  );

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

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

ALTER TABLE SMAN ADD ( SMAN_DOMESTICCHILDS_G1_Y NUMBER(6) NULL  );

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

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

ALTER TABLE YGRT ADD ( YGRT_YRCH_ID NUMBER(30) NULL  );

ALTER TABLE YGRT ADD ( YGRT_XCMA_ID NUMBER(30) NULL  );

ALTER TABLE YGRT ADD ( YGRT_SOU_ID NUMBER(30) NULL  );

ALTER TABLE YGRT ADD ( YGRT_CHA_ID NUMBER(30) NULL  );

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

ALTER TABLE YBLD ADD ( YBLD_TENTATIVE NUMBER(3) DEFAULT 0 NULL  );

ALTER TABLE YCMI ADD ( YCMI_MC_LONGDESC VARCHAR2(60) NULL  );

ALTER TABLE YCMI ADD ( YCMI_MC_POS_IFC NUMBER(30) NULL  );

ALTER TABLE YCMI ADD ( YCMI_TYPE NUMBER(1) NULL  );

ALTER TABLE YCMC ADD ( YCMC_MC_ID NUMBER(30) NULL  );

ALTER TABLE YCMR ADD ( YCMR_DEFAULT NUMBER(1) NULL  );

ALTER TABLE YCMR ADD ( YCMR_YOUT_ID NUMBER(30) NULL  );

ALTER TABLE YCMR ADD ( YCMR_ZDCO_ID NUMBER(30) NULL  );

ALTER TABLE YSMR ADD ( YSMR_DEFAULT NUMBER(1) NULL  );

ALTER TABLE YSMR ADD ( YSMR_YOUT_ID NUMBER(30) NULL  );

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

ALTER TABLE YCMR ADD ( YCMR_COSTPRICE NUMBER(30,4) NULL  );

ALTER TABLE YCMR ADD ( YCMR_MC_PRO_ID NUMBER(30) NULL  );

ALTER TABLE YEMI ADD ( YEMI_YOUT_ID NUMBER(30) NULL  );

ALTER TABLE YEMI ADD ( YEMI_COSTPRICE NUMBER(30,4) NULL  );

ALTER TABLE YEMN ADD ( YEMN_YOUT_ID NUMBER(30) NULL  );

ALTER TABLE ZTXC MODIFY ( ZTXC_LONGDESC VARCHAR2(60)  );

ALTER TABLE WQFD ADD ( WQFD_ROPT NUMBER(1) NULL  );

ALTER TABLE XCMS ADD ( XCMS_CONTACTPREF NUMBER(1) NULL  );

ALTER TABLE XCAP ADD ( XCAP_CRYPTOGRAM VARCHAR2(30) NULL  );

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

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

ALTER TABLE SMAD ADD ( SMAD_ARRCHILDSTOMORROW_D NUMBER(5) NULL  );

ALTER TABLE SMAD ADD ( SMAD_DEPCHILDSTOMORROW_D NUMBER(5) NULL  );

ALTER TABLE SMRT ADD ( SMRT_ARRCHILDSTOMORROW_D NUMBER(5) NULL  );

ALTER TABLE SMRT ADD ( SMRT_DEPCHILDSTOMORROW_D NUMBER(5) NULL  );

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

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

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

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

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

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

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

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

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

ALTER TABLE SMRT ADD ( SMRT_HOUSEUSE_ADULTS_D NUMBER(5) NULL  );

ALTER TABLE SMRT ADD ( SMRT_HOUSEUSE_ADULTS_M NUMBER(5) NULL  );

ALTER TABLE SMRT ADD ( SMRT_HOUSEUSE_ADULTS_Y NUMBER(7) NULL  );

ALTER TABLE SMRT ADD ( SMRT_WALKIN_ADULTS_D NUMBER(5) NULL  );

ALTER TABLE SMRT ADD ( SMRT_WALKIN_ADULTS_M NUMBER(5) NULL  );

ALTER TABLE SMRT ADD ( SMRT_WALKIN_ADULTS_Y NUMBER(7) NULL  );

ALTER TABLE SMRT ADD ( SMRT_DAYUSE_ADULTS_D NUMBER(5) NULL  );

ALTER TABLE SMRT ADD ( SMRT_DAYUSE_ADULTS_M NUMBER(5) NULL  );

ALTER TABLE SMRT ADD ( SMRT_DAYUSE_ADULTS_Y NUMBER(7) NULL  );


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


/*  SHIS  */

CREATE INDEX SHIS_YRES_EXPARRTIME ON SHIS
	(
	  SHIS_YRES_EXPARRTIME
	)
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
;
CREATE INDEX SHIS_YRES_EXPDEPTIME ON SHIS
	(
	  SHIS_YRES_EXPDEPTIME
	)
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
;
CREATE INDEX SHIS_YRMS_SHORTDESC ON SHIS
	(
	  SHIS_YRMS_SHORTDESC
	)
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
;



/*  YPRD  */

CREATE INDEX YPRD_ENDBOOKING ON YPRD
	(
	  YPRD_ENDBOOKING
	)
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
;
CREATE INDEX YPRD_STARTBOOKING ON YPRD
	(
	  YPRD_STARTBOOKING
	)
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
;



/*  YPRM  */

CREATE INDEX YPRM_ENDDATE ON YPRM
	(
	  YPRM_ENDDATE
	)
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
;
CREATE INDEX YPRM_STARTDATE ON YPRM
	(
	  YPRM_STARTDATE
	)
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
;



/*  YGRP  */

CREATE INDEX YGRP_YBLH_ID ON YGRP
	(
	   YGRP_YBLH_ID
	)
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
;


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


UPDATE ZFAG SET ZFAG_TYPE = 0 WHERE ZFAG_TYPE IS NULL;


UPDATE YCMR SET YCMR_ZDCO_ID=(SELECT YCMI_ZDCO_ID FROM YCMI WHERE YCMR_YCMI_ID=YCMI_ID);

UPDATE YCMR SET YCMR_COSTPRICE=(SELECT YCMI_COSTPRICE FROM YCMI WHERE YCMR_YCMI_ID=YCMI_ID);

UPDATE YCMR SET YCMR_DEFAULT=1;

UPDATE YSMR SET YSMR_DEFAULT=1;

UPDATE YCMI SET YCMI_TYPE=0;


UPDATE SMAN SET SMAN_HOUSEUSE_ADULTS_D = 0 WHERE SMAN_HOUSEUSE_ADULTS_D IS NULL;

UPDATE SMAN SET SMAN_HOUSEUSE_ADULTS_M = 0 WHERE SMAN_HOUSEUSE_ADULTS_M IS NULL;

UPDATE SMAN SET SMAN_HOUSEUSE_ADULTS_Y = 0 WHERE SMAN_HOUSEUSE_ADULTS_Y IS NULL;

UPDATE SMAN SET SMAN_WALKIN_ADULTS_D  = 0 WHERE SMAN_WALKIN_ADULTS_D  IS NULL;

UPDATE SMAN SET SMAN_WALKIN_ADULTS_M  = 0 WHERE SMAN_WALKIN_ADULTS_M  IS NULL;

UPDATE SMAN SET SMAN_WALKIN_ADULTS_Y  = 0 WHERE SMAN_WALKIN_ADULTS_Y  IS NULL;

UPDATE SMAN SET SMAN_DAYUSE_ADULTS_D  = 0 WHERE SMAN_DAYUSE_ADULTS_D  IS NULL;

UPDATE SMAN SET SMAN_DAYUSE_ADULTS_M  = 0 WHERE SMAN_DAYUSE_ADULTS_M  IS NULL;

UPDATE SMAN SET SMAN_DAYUSE_ADULTS_Y  = 0 WHERE SMAN_DAYUSE_ADULTS_Y  IS NULL;


UPDATE SMRT SET SMRT_HOUSEUSE_ADULTS_D = 0 WHERE SMRT_HOUSEUSE_ADULTS_D IS NULL;

UPDATE SMRT SET SMRT_HOUSEUSE_ADULTS_M = 0 WHERE SMRT_HOUSEUSE_ADULTS_M IS NULL;

UPDATE SMRT SET SMRT_HOUSEUSE_ADULTS_Y = 0 WHERE SMRT_HOUSEUSE_ADULTS_Y IS NULL;

UPDATE SMRT SET SMRT_WALKIN_ADULTS_D  = 0 WHERE SMRT_WALKIN_ADULTS_D  IS NULL;

UPDATE SMRT SET SMRT_WALKIN_ADULTS_M  = 0 WHERE SMRT_WALKIN_ADULTS_M  IS NULL;

UPDATE SMRT SET SMRT_WALKIN_ADULTS_Y  = 0 WHERE SMRT_WALKIN_ADULTS_Y  IS NULL;

UPDATE SMRT SET SMRT_DAYUSE_ADULTS_D  = 0 WHERE SMRT_WALKIN_ADULTS_D  IS NULL;

UPDATE SMRT SET SMRT_DAYUSE_ADULTS_M  = 0 WHERE SMRT_WALKIN_ADULTS_M  IS NULL;

UPDATE SMRT SET SMRT_DAYUSE_ADULTS_Y  = 0 WHERE SMRT_WALKIN_ADULTS_Y  IS NULL;


--- End of DBDiff for Oracle --- Elapsed Time: 00:43:23 ---
