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


/************************************************************************************************************************
*
*  The following statements will upgrade from 8_9_6_0 to 8_9_6_1
*
*
************************************************************************************************************************/

ALTER TABLE YCEP ADD YCEP_yres_ID NUMBER(30);

CREATE TABLE YCEF (
   YCEF_ID NUMBER(30) NOT NULL  
  ,YCEF_YCEP_ID NUMBER(30) NOT NULL
  ,YCEF_YFXC_SCRID NUMBER(30) NOT NULL 
  ,CONSTRAINT YCEF_PK PRIMARY KEY (YCEF_ID) USING INDEX TABLESPACE V8INDEX
) TABLESPACE V8MAIN;
   
CREATE SEQUENCE SEQ_YCEF INCREMENT BY 1 START WITH 1000 NOMAXVALUE NOCYCLE NOCACHE NOORDER;

COMMENT ON TABLE YCEF IS 'Reservation Calendar Event Fixed Charge Link';

ALTER TABLE YCEV ADD YCEV_YPAC_ID NUMBER(30);

ALTER TABLE YCEV ADD YCEV_USEPACKAGE NUMBER(1);

COMMENT ON COLUMN YCEV.YCEV_USEPACKAGE IS 'Link Package to Calendar Event';

ALTER TABLE YCEP ADD YCEP_YPAC_ID NUMBER(30);

COMMENT ON COLUMN YCEP.YCEP_YPAC_ID IS 'Linked Package id';

CREATE TABLE YCPC (
   YCPC_ID NUMBER(30) NOT NULL  
  ,YCPC_YCEP_ID NUMBER(30) NOT NULL
  ,YCPC_XCAC_ID NUMBER(30)
  ,YCPC_TYPE NUMBER(1)
  ,YCPC_COUNT NUMBER(30)
  ,YCPC_PRICE NUMBER(30, 4)
  ,YCPC_AMOUNT NUMBER(30,4)
  ,CONSTRAINT YCPC_PK PRIMARY KEY (YCPC_ID) USING INDEX TABLESPACE V8INDEX
) TABLESPACE V8MAIN;
   
CREATE SEQUENCE SEQ_YCPC INCREMENT BY 1 START WITH 1000 NOMAXVALUE NOCYCLE NOCACHE NOORDER;

COMMENT ON TABLE YCPC IS ' Calendar Event Participant - Age Category wise split details';

COMMENT ON COLUMN YCPC.YCPC_YCEP_ID IS 'Linked to ycep';

COMMENT ON COLUMN YCPC.YCPC_XCAC_ID IS 'Linked to xcac Child Categories value 0 is for Adults';

COMMENT ON COLUMN YCPC.YCPC_TYPE IS '0.Children 1.Adult';  

COMMENT ON COLUMN YCPC.YCPC_COUNT IS 'Number of persons';

COMMENT ON COLUMN YCPC.YCPC_PRICE IS 'Ticket Price';

COMMENT ON COLUMN YCPC.YCPC_AMOUNT IS 'Ticket Amount';

ALTER TABLE YPAL ADD YPAL_MASTER_YPAC_ID NUMBER(30,0);

ALTER TABLE YCEP ADD YCEP_REVENUE_POSTDATE DATE;

COMMENT ON COLUMN YCEP.YCEP_REVENUE_POSTDATE IS 'revenue post date';

CREATE TABLE WMWS (
   WMWS_ID NUMBER(30) NOT NULL
  ,WMWS_SHORTDESC VARCHAR2(3)
  ,WMWS_LONGDESC VARCHAR2(60)
  ,WMWS_REMARKS VARCHAR2(2000)
  ,WMWS_XCED_ID NUMBER(30)
  ,WMWS_WSQL_ID NUMBER(30)
  ,WMWS_TIMESTAMP DATE
  ,CONSTRAINT WMWS_PK PRIMARY KEY (WMWS_ID) USING INDEX TABLESPACE V8INDEX
) TABLESPACE V8MAIN;

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

COMMENT ON TABLE WMWS IS 'Saved Mailing Wizard Settings';

CREATE TABLE WMWZ (
   WMWZ_ID NUMBER(30) NOT NULL
  ,WMWZ_WMWS_ID NUMBER(30)
  ,WMWZ_WMWD_ID NUMBER(30)
  ,WMWZ_WMWD_INCL NUMBER(1)
  ,WMWZ_WMWG_ID NUMBER(30)
  ,WMWZ_WMWF_ID NUMBER(30)
  ,CONSTRAINT WMWZ_PK PRIMARY KEY (WMWZ_ID) USING INDEX TABLESPACE V8INDEX
) TABLESPACE V8MAIN;

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

COMMENT ON TABLE WMWZ IS 'Saved Mailing Wizard Settings link table';

ALTER TABLE WMWE DROP COLUMN WMWE_WMWC_ID;

ALTER TABLE WMWE ADD WMWE_WMWS_ID NUMBER(30);

ALTER TABLE WSQP ADD WSQP_INCLUDEPARAM NUMBER(1);

COMMENT ON COLUMN WSQP.WSQP_INCLUDEPARAM IS '1 = Parameter is included, 0 = excluded';

CREATE TABLE WMWX (
   WMWX_ID NUMBER(30) NOT NULL
  ,WMWX_WMWP_ID NUMBER(30)
  ,WMWX_WMWP_INCL NUMBER(1)
  ,WMWX_WMWE_ID NUMBER(30)
  ,WMWX_TIMESTAMP DATE
  ,WMWX_PARAMCONTENT VARCHAR2(2000)
  ,CONSTRAINT WMWX_PK PRIMARY KEY (WMWX_ID) USING INDEX TABLESPACE V8INDEX
) TABLESPACE V8MAIN;

COMMENT ON TABLE WMWX IS 'Mailing Wizard SQL execution detail Log';

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

ALTER TABLE WSQP ADD WSQP_WMWP_ID NUMBER(30);

COMMENT ON COLUMN WSQP.WSQP_WMWP_ID IS 'Link to the parameters of the mailing that generated the sql with this parameter  ';

ALTER TABLE WNAE ADD WNAE_REPORT_TYPE NUMBER(2);

COMMENT ON COLUMN WNAE.WNAE_REPORT_TYPE IS 'Indicates the report type for ideas 1 = CurrentTotal, 2 = CurrentTotalRT, 3 = CurrentSegRT, 4 = PastTotal, 5 = PastTotalRT, 6 = PastSegRT';

ALTER TABLE YCEP ADD YCEP_RESCREATED NUMBER(1);

COMMENT ON COLUMN YCEP.YCEP_RESCREATED IS 'indicates this participant is created to link to a reservation ';

ALTER TABLE WLOP MODIFY WLOP_TYPE NUMBER(2);

ALTER TABLE YHKS MODIFY YHKS_GREENSTATUSDAYS NUMBER( 3);

COMMENT ON COLUMN YHKS.YHKS_GREENSTATUS IS 'One record in YHKS to be identified for Green Status (not used too long and review needed)';

COMMENT ON COLUMN YHKS.YHKS_GREENSTATUSDAYS IS 'Number of days for Green Status (not used too long and review needed)';

ALTER TABLE MMOD ADD MMOD_INCL_ADD_TO_RATE NUMBER(1);

COMMENT ON COLUMN MMOD.MMOD_INCL_ADD_TO_RATE IS 'indicates whether add to rate packages should be uploaded within the reservation rate';

ALTER TABLE MAVL ADD MAVL_UPLOAD_RATE NUMBER(1);

ALTER TABLE MAVL ADD MAVL_UPLOAD_RAVL NUMBER(1);

COMMENT ON COLUMN MAVL.MAVL_UPLOAD_RATE IS 'indicates whether the rate code is used for rate upload';

COMMENT ON COLUMN MAVL.MAVL_UPLOAD_RAVL IS 'indicates whether the rate code is used for ravl upload';

UPDATE MAVL SET MAVL_UPLOAD_RATE = 1, MAVL_UPLOAD_RAVL = 1;

ALTER TABLE XCCS ADD XCCS_CARD_ID VARCHAR2(100 CHAR);

ALTER TABLE XCCS ADD XCCS_CARD_ID_TYPE NUMBER(1);

COMMENT ON COLUMN XCCS.XCCS_CARD_ID IS 'CC token used by Best Western';

COMMENT ON COLUMN XCCS.XCCS_CARD_ID_TYPE IS 'Source of Token 1 = local interface, 2 = CRS';

ALTER TABLE MMOD ADD MMOD_ALLOW_ZERO_PRICE_PACKAGE NUMBER(1);

COMMENT ON COLUMN MMOD.MMOD_ALLOW_ZERO_PRICE_PACKAGE IS 'indicates whether an interface accepts zero rates for packages. If not the price from Suite8 will be used';

ALTER TABLE WPCA MODIFY WPCA_BARCODEREADERPORT NUMBER(2);

COMMENT ON COLUMN WRPS.WRPS_TYPE IS '0 = report  1 = text format template 2 = Cube Reports templates 3 = Html templates 4= FastReport templates 5 = Word Merge templates ';

ALTER TABLE YHAT ADD YHAT_XCED_ID NUMBER(30);

COMMENT ON COLUMN YHAT.YHAT_XCED_ID IS 'Attendant link to user';

COMMENT ON TABLE WRTR IS ' Report and HTML Translation  Loading all static strings from Reports and HTMLs.';

UPDATE MMOD SET MMOD_INCL_ADD_TO_RATE = 1;

CREATE TABLE YLSP (
   YLSP_ID NUMBER(30) NOT NULL
  ,YLSP_YRES_ID NUMBER(30) NOT NULL 
  ,YLSP_START DATE NOT NULL
  ,YLSP_END DATE NOT NULL
  ,YLSP_MANUAL NUMBER(1) DEFAULT 0 NOT NULL
  ,YLSP_AMOUNT NUMBER(30,4) NOT NULL
  ,YLSP_FAMOUNT NUMBER(30,4)
  ,YLSP_PARTIAL NUMBER(1) DEFAULT 0 NOT NULL
  ,YLSP_ZINV_ID NUMBER(30)
  ,YLSP_POSTDATE DATE
  ,YLSP_ZWIN_ID NUMBER(30)
  ,CONSTRAINT YLSP_PK PRIMARY KEY (YLSP_ID) USING INDEX TABLESPACE V8INDEX
) TABLESPACE V8CONF;
    
CREATE SEQUENCE SEQ_YLSP INCREMENT BY 1 START WITH 1000 NOMAXVALUE NOCYCLE NOCACHE NOORDER;

COMMENT ON TABLE YLSP IS 'Lease period';

CREATE TABLE YRGV (
   YRGV_ID NUMBER(30) NOT NULL
  ,YRGV_YRMS_ID NUMBER(30) NOT NULL
  ,YRGV_FROM DATE NOT NULL
  ,YRGV_TO DATE NOT NULL
  ,YRGV_VALUE NUMBER(30,4) NOT NULL 
  ,CONSTRAINT YRGV_PK PRIMARY KEY (YRGV_ID) USING INDEX TABLESPACE V8INDEX
) TABLESPACE V8CONF;

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

COMMENT ON TABLE YRGV IS 'Government room value evaluation for tax exempt part of room charge';

CREATE TABLE YCGV (
   YCGV_ID NUMBER(30) NOT NULL
  ,YCGV_YCAT_ID NUMBER(30) NOT NULL
  ,YCGV_FROM DATE NOT NULL
  ,YCGV_TO DATE NOT NULL
  ,YCGV_VALUE NUMBER(30,4) NOT NULL 
  ,CONSTRAINT YCGV_PK PRIMARY KEY (YCGV_ID) USING INDEX TABLESPACE V8INDEX
) TABLESPACE V8CONF;

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

COMMENT ON TABLE YCGV IS 'Government room typevalue evaluation for tax exempt part of room charge';

ALTER TABLE YRCH ADD YRCH_ASB NUMBER(1) DEFAULT 0 NOT NULL;

COMMENT ON COLUMN YRCH.YRCH_ASB IS 'Apartment style billing';

ALTER TABLE YRCH ADD YRCH_POSTINGRHYTHM NUMBER(1) DEFAULT 0 NOT NULL;

COMMENT ON COLUMN YRCH.YRCH_POSTINGRHYTHM IS '0=Weekly 1=Monthly 2=Yearly 3=CustomDays';

ALTER TABLE YRCH ADD YRCH_POSTINGRHYTHMDAYS NUMBER(3);

COMMENT ON COLUMN YRCH.YRCH_POSTINGRHYTHMDAYS IS 'Number of days for "Custom" posting rhythm';

ALTER TABLE YRCH ADD YRCH_POSTINGRHYTHMSTART NUMBER(1) DEFAULT 0 NOT NULL;

COMMENT ON COLUMN YRCH.YRCH_POSTINGRHYTHMSTART IS '0=Check in date 1=First day of posting rhythm';

ALTER TABLE YRCH ADD YRCH_TAXEXEMPT_ZDCO_ID NUMBER(30);

COMMENT ON COLUMN YRCH.YRCH_TAXEXEMPT_ZDCO_ID IS 'Department code for tax exempt part of room charge';

INSERT INTO WUSS(WUSS_ID, WUSS_XCMS_ID, WUSS_NAME, WUSS_VALUE)
SELECT SEQ_WUSS.NEXTVAL, 0, 'MenuCourseSeparator', '***' 
FROM DUAL
WHERE NOT EXISTS (SELECT WUSS_ID FROM WUSS WHERE WUSS_NAME='MenuCourseSeparator');

commit;

INSERT INTO WUSS(WUSS_ID, WUSS_XCMS_ID, WUSS_NAME, WUSS_VALUE)
SELECT SEQ_WUSS.NEXTVAL, 0, 'TranslationMethod', '0' 
FROM DUAL
WHERE NOT EXISTS (SELECT WUSS_ID FROM WUSS WHERE WUSS_NAME='TranslationMethod');

commit;

COMMENT ON COLUMN WANT.WANT_NOTES_CLOB IS 'Obsolete field, not used anymore';

COMMENT ON COLUMN WANT.WANT_NOTES IS 'Actual note';

/************************************************************************************************************************
*
*  The following statements will upgrade from 8_9_6_1 to 8_9_6_2
*
*
************************************************************************************************************************/

CREATE TABLE WSPD
(
   WSPD_ID         NUMBER (30) NOT NULL,
   WSPD_DATE       DATE,
   WSPD_DOWNLOAD   VARCHAR2 (60),
   WSPD_UPLOAD     VARCHAR2 (60),
   WSPD_XCED_ID    NUMBER (30),
   CONSTRAINT WSPD_PK PRIMARY KEY (WSPD_ID) USING INDEX TABLESPACE V8INDEX
)
TABLESPACE v8MAIN;

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

COMMENT ON TABLE WSPD IS 'Table to store the results for speed test functionality in webSuite';

COMMENT ON COLUMN WSPD.WSPD_ID IS 'unique id';

COMMENT ON COLUMN WSPD.WSPD_DATE IS 'Date and time of speed test start';

COMMENT ON COLUMN WSPD.WSPD_DOWNLOAD IS 'Result of download speed';

COMMENT ON COLUMN WSPD.WSPD_UPLOAD IS 'Result of upload speed';

COMMENT ON COLUMN WSPD.WSPD_XCED_ID IS 'User ID of user who started speed test';


CREATE TABLE ZTIS (
   ZTIS_ID NUMBER(30) not null
  ,ZTIS_ZTCD_ID NUMBER(30)
  ,ZTIS_ORDER NUMBER(4)
  ,ZTIS_FROMAMOUNT NUMBER(30, 4)
  ,ZTIS_TOAMOUNT NUMBER(30, 4)
  ,ZTIS_UDF VARCHAR2(200 char)
  ,CONSTRAINT ZTIS_PK PRIMARY KEY (ZTIS_ID) USING INDEX TABLESPACE V8INDEX
) TABLESPACE V8MAIN;

COMMENT ON TABLE ZTIS IS 'Indian Luxury Tax / SLAB configuration';

COMMENT ON COLUMN ZTIS.ZTIS_ZTCD_ID IS 'Link to tax detail';

COMMENT ON COLUMN ZTIS.ZTIS_FROMAMOUNT IS 'The amount range''s lower limit, inclusive';

COMMENT ON COLUMN ZTIS.ZTIS_TOAMOUNT IS 'The amount range''s upper limit, exclusive';

COMMENT ON COLUMN ZTIS.ZTIS_UDF IS 'The tax formula associated with this amount range';

COMMENT ON COLUMN ZTIS.ZTIS_ORDER IS 'The order number associated with this amount range';

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

CREATE TABLE ZTDR (
   ZTDR_ID NUMBER(30) not null
  ,ZTDR_ZTCD_ID NUMBER(30)
  ,ZTDR_YRCH_ID NUMBER(30)
  ,CONSTRAINT ZTDR_PK PRIMARY KEY (ZTDR_ID) USING INDEX TABLESPACE V8INDEX
) TABLESPACE V8MAIN;

COMMENT ON TABLE ZTDR IS 'Indian Luxury Tax / Link tax detail to rate codes';

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

ALTER TABLE ZDTL ADD ZDTL_CALCRULE NUMBER(1);

COMMENT ON COLUMN ZDTL.ZDTL_CALCRULE IS 'Indian Luxury Tax / calculation rule for this tax / 0 Not assigned, 1 - Charged Rate, 2 - Rack Rate, 3 - Higher Rate';

ALTER TABLE ZOTA ADD ZOTA_UPLOAD_ALL_RT NUMBER(1); 

COMMENT ON COLUMN ZOTA.ZOTA_UPLOAD_ALL_RT IS 'Upload for all room types availability with 0, if house availability = 0';

ALTER TABLE MMOD ADD MMOD_ALTERNATIVE_RES_ATTR NUMBER(1);

COMMENT ON COLUMN MMOD.MMOD_ALTERNATIVE_RES_ATTR IS 'Trust Voyager option to setup the use of specific attributes in the reservation message as source, channel and market code';

ALTER TABLE ZDCO MODIFY ZDCO_NUMERICDESC NUMBER(10);

ALTER TABLE YRCH ADD YRCH_TAXED_ZDCO_ID NUMBER(30);

COMMENT ON COLUMN YRCH.YRCH_TAXED_ZDCO_ID IS 'Department code for taxed part of room charge';

INSERT INTO WUSS (WUSS_ID,
                  WUSS_XCMS_ID,
                  WUSS_NAME,
                  WUSS_VALUE)
     VALUES (SEQ_WUSS.NEXTVAL,
             0,
             'ShowMailingStandard',
             '1');
             
INSERT INTO WUSS (WUSS_ID,
                  WUSS_XCMS_ID,
                  WUSS_NAME,
                  WUSS_VALUE)
     VALUES (SEQ_WUSS.NEXTVAL,
             0,
             'ShowMailingAdvanced',
             '1');
	 
ALTER TABLE YFOR ADD YFOR_CATEGORY NUMBER(1) DEFAULT 0;

ALTER TABLE ZPOS ADD ZPOS_RESERVATIONDAY DATE;

COMMENT ON COLUMN ZPOS.ZPOS_RESERVATIONDAY IS 'Date of daily postings. Ie When all nights of a reservation are posted in advance, this stores each night''s date.';

CREATE TABLE YCTG
(
  YCTG_ID          NUMBER(30)                   NOT NULL,
  YCTG_SHORTDESC   VARCHAR2(3 BYTE)             NOT NULL,
  YCTG_LONGDESC    VARCHAR2(30 BYTE)            NOT NULL,
  YCTG_DISPLORDER  NUMBER(3),
  YCTG_INACTIVE    NUMBER(1),
  YCTG_WHDE_ID        NUMBER(30),
  CONSTRAINT YCTG_PK PRIMARY KEY (YCTG_ID) USING INDEX TABLESPACE V8INDEX) TABLESPACE V8CONF;

COMMENT ON TABLE YCTG IS 'Guest Comment Type Groups';

COMMENT ON COLUMN YCTG.YCTG_ID IS ' YCTG_ID identifies YCTG';

COMMENT ON COLUMN YCTG.YCTG_SHORTDESC IS ' YCTG_SHORTDESC is of YCTG';

COMMENT ON COLUMN YCTG.YCTG_LONGDESC IS ' YCTG_LONGDESC is of YCTG';

COMMENT ON COLUMN YCTG.YCTG_DISPLORDER IS ' YCTG_DISPLORDER is of YCTG';

COMMENT ON COLUMN YCTG.YCTG_INACTIVE IS ' 0=active, 1=inactive  ';

COMMENT ON COLUMN YCTG.YCTG_WHDE_ID IS 'Link to responsible departments';

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

ALTER TABLE YCMG ADD YCMG_YCTG_ID NUMBER(30);

ALTER TABLE YCMP ADD YCMP_TYPESTATUS NUMBER(1);

ALTER TABLE WACT ADD WACT_FROM_COPY_WACT_ID NUMBER(30) DEFAULT 0;

COMMENT ON COLUMN WACT.WACT_FROM_COPY_WACT_ID IS 'from copy wact_id';

ALTER TABLE YCMP ADD YCMP_RECEIVED_XCED_ID  NUMBER(30);

COMMENT ON COLUMN YCMP.YCMP_RECEIVED_XCED_ID IS 'received by xced_id';

ALTER TABLE W8HP ADD W8HP_MYHOTELSHOPTRACKINGPIXEL NUMBER(1);

ALTER TABLE W8HP ADD W8HP_MYHOTELSHOPID VARCHAR2(20);


/************************************************************************************************************************
*
*  The following statements will upgrade from 8_9_6_2 to 8_9_6_3
*
*
************************************************************************************************************************/

ALTER TABLE WCIP ADD WCIP_INTERFACES VARCHAR2(20);

INSERT INTO WUSR (WUSR_ID,WUSR_XCMS_ID,WUSR_WEGR_ID,WUSR_NAME,WUSR_VALUE)
SELECT SEQ_WUSR.NEXTVAL,WUSR_XCMS_ID,WUSR_WEGR_ID
  ,WUSR_NAME||'Access'
  ,WUSR_VALUE
FROM WUSR w
WHERE  
w.WUSR_NAME IN (
  'Configuration'
 ,'ConfigurationCashiering'
 ,'ConfigurationReservations'
 ,'ConfigurationReservationsRate Management'
 ,'ConfigurationUsers'
 ,'ConfigurationMiscellaneous'
 ) 
AND NOT EXISTS (
  SELECT 1 
  FROM WUSR ww
  WHERE (w.WUSR_XCMS_ID=ww.WUSR_XCMS_ID or w.WUSR_XCMS_ID IS NULL) 
  AND (w.WUSR_WEGR_ID=ww.WUSR_WEGR_ID or w.WUSR_WEGR_ID IS NULL) 
  AND ww.WUSR_NAME=w.WUSR_NAME||'Access' 
);

ALTER TABLE ZPOS ADD ZPOS_FLAG NUMBER(1);

COMMENT ON COLUMN ZPOS.ZPOS_FLAG IS '1=Inverted by billing period';

create TABLE WSYN (
    WSYN_ID NUMBER(30) not null
   ,WSYN_PROVIDER NUMBER(30) not null
   ,WSYN_TABLENAME VARCHAR2(4) not null
   ,WSYN_TABLE_ID NUMBER(30) not null
   ,WSYN_THIRDPARTY_ID VARCHAR2(30)
   ,WSYN_DOWNLOADTIMESTAMP DATE
   ,CONSTRAINT WSYN_PK PRIMARY KEY (WSYN_ID) USING INDEX TABLESPACE v8INDEX) TABLESPACE V8CONF;

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

COMMENT ON TABLE WSYN IS 'sync table between suite8 / third parties resources';

COMMENT ON COLUMN WSYN.WSYN_ID IS 'ID';

COMMENT ON COLUMN WSYN.WSYN_PROVIDER IS 'Provider identif: 0 - Micros/Alshaya';

COMMENT ON COLUMN WSYN.WSYN_TABLENAME IS 'Suite8 TABLE name';

COMMENT ON COLUMN WSYN.WSYN_TABLE_ID IS 'Suite8 TABLE ID';

COMMENT ON COLUMN WSYN.WSYN_THIRDPARTY_ID IS 'Thirdparty ID';

ALTER TABLE AACC ADD AACC_CREDSUMM NUMBER(30,4);

COMMENT ON COLUMN AACC.AACC_CREDSUMM IS 'Credit summ';
                 
ALTER TABLE AACC ADD AACC_CREDIT_FLAG NUMBER(1) default 0;

COMMENT ON COLUMN AACC.AACC_CREDIT_FLAG IS 'Credit flag';

ALTER TABLE AACC ADD AACC_SITE_NUMBER VARCHAR2(20);

COMMENT ON COLUMN AACC.AACC_SITE_NUMBER IS 'Site NUMBER';

ALTER TABLE WMWP ADD WMWP_PARA_DESC VARCHAR2(30);

COMMENT ON COLUMN WMWP.WMWP_PARA_DESC IS 'readable description of the parameter';

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

ALTER TABLE YDEP ADD YDEP_ZCUR_ID NUMBER(30);

ALTER TABLE YDEP ADD YDEP_ZDCO_ID NUMBER(30);

ALTER TABLE YDEP ADD YDEP_COMMENT VARCHAR2(60);

ALTER TABLE YCDR ADD YCDR_ZCUR_ID NUMBER(30);

ALTER TABLE YCDR ADD YCDR_ZDCO_ID NUMBER(30);

create TABLE XREM (
    XREM_ID NUMBER(30) not null
   ,XREM_XMTY_ID NUMBER(30) not null
   ,XREM_LEVEL VARCHAR2(30)
   ,XREM_INFO VARCHAR2(120)   
   ,CONSTRAINT XREM_PK PRIMARY KEY (XREM_ID) USING INDEX TABLESPACE v8INDEX) TABLESPACE V8CONF;

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

COMMENT ON TABLE XREM IS 'Reminder popup for membership types';

COMMENT ON COLUMN XREM.XREM_ID IS 'ID';

COMMENT ON COLUMN XREM.XREM_XMTY_ID IS 'Link to membership type';

COMMENT ON COLUMN XREM.XREM_INFO IS 'Reminder Information';

ALTER TABLE ZFAG ADD ZFAG_DEPDATE_DAY NUMBER(2);

COMMENT ON COLUMN ZFAG.ZFAG_DEPDATE_DAY IS 'the day of the month on which the FA should be checked out';

ALTER TABLE YLSP ADD YLSP_PROFORMATIME DATE;

ALTER TABLE ZDCO ADD ZDCO_SECDEPRETURN_ZDCO_ID NUMBER(30);

COMMENT ON COLUMN ZDCO.ZDCO_SECDEPRETURN_ZDCO_ID IS 'Security deposit return department code';

ALTER TABLE ZTTL ADD ZTTL_FORM NUMBER(1);

COMMENT ON COLUMN ZTTL.ZTTL_FORM IS '0 = Full-Form, 1 = Abbreviated Form';

ALTER TABLE WPCA ADD WPCA_THAIWSNUMBER VARCHAR2(5 char);

COMMENT ON COLUMN WPCA.WPCA_THAIWSNUMBER IS 'Workstation NUMBER for Abbreviated Form Thai Tax';

ALTER TABLE ZTTL MODIFY ZTTL_TAXNUMBER VARCHAR2(20 CHAR);

ALTER TABLE ZFAC ADD ZFAC_STATUS NUMBER(1);

COMMENT ON COLUMN ZFAC.ZFAC_STATUS IS '0 =  FA Open for change, 1 = FA  Closed for change';

ALTER TABLE ZTTL ADD ZTTL_WPCA_ID NUMBER(30);

ALTER TABLE YRES ADD YRES_SPLIT_CONFIRMATIONNO VARCHAR2(10);

create TABLE ZAML (
   ZAML_ID NUMBER(30) not null
  ,ZAML_WACT_ID NUMBER(30)
  ,ZAML_YRMS_ID NUMBER(30)
  ,ZAML_YHAT_ID NUMBER(30)
  ,ZAML_RESOLVED_YHKS_ID NUMBER(30)
  ,CONSTRAINT ZAML_PK PRIMARY KEY (ZAML_ID) USING INDEX TABLESPACE v8INDEX
) TABLESPACE V8MAIN;

COMMENT ON TABLE ZAML IS 'Link between attendants and tasks created for them on the attendant plan';

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

ALTER TABLE YBOM ADD YBOM_STATUS NUMBER(1);

COMMENT ON COLUMN YBOM.YBOM_STATUS IS '0-Not closed; 1-Booking closed';

ALTER TABLE WATG DROP COLUMN WATG_ZFAC;

COMMENT ON COLUMN XCLR.XCLR_TYPE IS '1-Spouse, 2-next geneneration (descendant), 3-prev gen (predecessor), 4-siblings, 5-partners, 6-Relative, 7-Distant Relative | for parents should be 3, for children 2';

ALTER TABLE XCLR ADD XCLR_LEVEL NUMBER(1);

COMMENT ON COLUMN XCLR.XCLR_LEVEL IS '0 - parents/childs; 1 - grandparents/grandchilds';

ALTER TABLE ZOTA ADD ZOTA_INCL_ADD_TO_RATE NUMBER(1);

COMMENT ON COLUMN ZOTA.ZOTA_INCL_ADD_TO_RATE IS 'indicates whether ADD to rate packages should be uploaded within the reservation rate';

ALTER TABLE MQU1 ADD MQU1_UNIQUE_MSG_ID VARCHAR2(200 CHAR); 

COMMENT ON COLUMN MQU1.MQU1_UNIQUE_MSG_ID IS 'new field for unique identify of a message reqeust to avoid duplicates if CRS resends message';

ALTER TABLE MCFG ADD MCFG_IFC_IP VARCHAR2(20) null;

COMMENT ON COLUMN MCFG.MCFG_IFC_IP IS 'Local IP address of the machine on which the interface IS installed';

DELETE FROM WFLS WHERE (SELECT WUSS_VALUE FROM WUSS WHERE WUSS_NAME LIKE 'v8lictype') <> 1 AND (SELECT COUNT(*) FROM WFLS) < 100;

DELETE FROM WLIC WHERE WLIC.WLIC_LICENSENAME IN 
(
'v8pms',
'Ticketing',  
'Opus2YieldIFC',
'Promotions',
'TourOperatorInvoice',
'BillingComponent',
'CCMMCInterface',
'CRS ONE WAY - Suite 8 Channel Manager',
'CRS TWO WAY - Suite 8 Channel Manager',
'CRS ONE WAY - MFNET ORS',
'CRS TWO WAY - MFNET ORS',
'AddressDoctorIntegration',
'MAILING',
'Synchronization',
'AVSRegCard',
'BILL_VIEW',
'CHECK_IN_OUT',
'EFT_SYSTEM',
'ENHANCED_POSTING',
'FULL_CAS',
'KEY_SYSTEM',
'PARTIAL_CAS',
'CHECK_DETAILS',
'REMOTE_CHECK_OUT',
'SIMPLE_POSTING',
'TEXT_MESSAGE',
'VIRTUAL_NUMBERS',
'VOICEMAIL',
'WAKEUP',
'blocks'
);


/************************************************************************************************************************
*
*  The following statements will upgrade from 8_9_6_4 to 8_9_6_10
*
*
************************************************************************************************************************/

INSERT INTO WUSS (WUSS_ID,
                  WUSS_XCMS_ID,
                  WUSS_NAME,
                  WUSS_VALUE)
SELECT seq_wuss.NEXTVAL,0,'BGS / FA group filters0',SUBSTR(WUSS_VALUE,1,60)
FROM WUSS
WHERE WUSS_NAME = 'BGS / FA group filters'
AND  NOT EXISTS (SELECT WUSS_ID FROM WUSS WHERE WUSS_NAME='BGS / FA group filters0');

ALTER TABLE MMOD ADD MMOD_CRS_CURRENCY NUMBER(30,0);

COMMENT ON COLUMN MMOD.MMOD_CRS_CURRENCY IS 'if it is set then the reservation price is exchanged to this currency if it is different to default hotel currency. Only for BW';

ALTER TABLE YHFS ADD (YHFS_HTLSGMTFILTER VARCHAR2(100 char), YHFS_ROOMTYPEFILTER VARCHAR2(100 char));

COMMENT ON COLUMN YHFS.YHFS_HTLSGMTFILTER IS 'place to save the hotel segments attendant screen filter';

COMMENT ON COLUMN YHFS.YHFS_ROOMTYPEFILTER IS 'place to save the room type attendant screen filter';

ALTER TABLE ZCHE ADD ZCHE_DOCUMENTFORMAT NUMBER(1);

COMMENT ON COLUMN ZCHE.ZCHE_DOCUMENTFORMAT IS 'Document format 0.Text, 1.PDF';


/************************************************************************************************************************
*
*  tables
*
*  1070 tables were found in VERSION_8_10_0@V8TEST2
*  1066 tables were found in VERSION_8_9_6@V8TEST2
*
************************************************************************************************************************/


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


DROP TABLE VERSION_8_9_6_0;


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


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


/*  WPRT  */
CREATE TABLE WPRT (
	 WPRT_ID	NUMBER(30)	NOT NULL
	,WPRT_NAME	VARCHAR2(60)	    NULL
	,WPRT_VALUE	VARCHAR2(1000)	    NULL
)
TABLESPACE V8MAIN
    STORAGE (
	INITIAL 64K
	NEXT 1M
	MINEXTENTS 1
	MAXEXTENTS 2147483645
	PCTINCREASE 50
	FREELISTS 1 FREELIST GROUPS 1
        )
;

ALTER TABLE WPRT ADD (
	CONSTRAINT WPRT_PK
	PRIMARY KEY
	            (
	             WPRT_ID
	            )
	USING INDEX
	TABLESPACE V8INDEX
)
;

ALTER TABLE WPRT ADD (
	CONSTRAINT SYS_C00260672
	UNIQUE
	       (
	        WPRT_NAME
	       )
	USING INDEX
	TABLESPACE V8MAIN
)
;

/*  YBBW  */
CREATE TABLE YBBW (
	 YBBW_ID	NUMBER(30)	NOT NULL
	,YBBW_YBLH_ID	NUMBER(30)	NOT NULL
	,YBBW_YRCH_ID	NUMBER(30)	    NULL
	,YBBW_BLOCK_TYPE	VARCHAR2(20)	    NULL
	,YBBW_BLOCK_LEAD_ID	VARCHAR2(50)	    NULL
	,YBBW_BOOKING_CHANNEL	NUMBER(1)	    NULL
	,YBBW_PROMISED_NON	NUMBER(4)	    NULL
	,YBBW_PROMISED_LOW_RATE	NUMBER(30,4)	    NULL
	,YBBW_PROMISED_HIGH_RATE	NUMBER(30,4)	    NULL
	,YBBW_ONLINE_URL	VARCHAR2(200)	    NULL
)
TABLESPACE V8MAIN
    STORAGE (
	INITIAL 64K
	NEXT 1M
	MINEXTENTS 1
	MAXEXTENTS 2147483645
	PCTINCREASE 50
	FREELISTS 1 FREELIST GROUPS 1
        )
;

ALTER TABLE YBBW ADD (
	CONSTRAINT YBBW_PK
	PRIMARY KEY
	            (
	             YBBW_ID
	            )
	USING INDEX
	TABLESPACE V8INDEX
)
;

/*  YBCR  */
CREATE TABLE YBCR (
	 YBCR_ID	NUMBER(30)	NOT NULL
	,YBCR_YBLH_ID	NUMBER(30)	NOT NULL
	,YBCR_CRSSYSTEM	VARCHAR2(30)	NOT NULL
	,YBCR_CRSBLOCKID	VARCHAR2(50)	    NULL
)
TABLESPACE V8MAIN
    STORAGE (
	INITIAL 64K
	NEXT 1M
	MINEXTENTS 1
	MAXEXTENTS 2147483645
	PCTINCREASE 50
	FREELISTS 1 FREELIST GROUPS 1
        )
;

ALTER TABLE YBCR ADD (
	CONSTRAINT YBCR_PK
	PRIMARY KEY
	            (
	             YBCR_ID
	            )
	USING INDEX
	TABLESPACE V8INDEX
)
;

/*  YRRR  */
CREATE TABLE YRRR (
	 YRRR_ID	NUMBER(30)	NOT NULL
	,YRRR_RESA_YRES_ID	NUMBER(30)	NOT NULL
	,YRRR_RESB_YRES_ID	NUMBER(30)	NOT NULL
	,YRRR_RELATION	NUMBER(1)	NOT NULL
)
TABLESPACE V8MAIN
    STORAGE (
	INITIAL 64K
	NEXT 1M
	MINEXTENTS 1
	MAXEXTENTS 2147483645
	PCTINCREASE 50
	FREELISTS  1 FREELIST GROUPS 1
        )
;

ALTER TABLE YRRR ADD (
	CONSTRAINT YRRR_PK
	PRIMARY KEY
	            (
	             YRRR_ID
	            )
	USING INDEX
	TABLESPACE V8INDEX
)
;




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

CREATE TABLE ZTXL(
    ZTXL_ID NUMBER(30) NOT NULL
   ,ZTXL_ztxx_id NUMBER(30) NOT NULL
   ,ZTXL_ztxc_id NUMBER(30) NOT NULL
   ,CONSTRAINT ZTXL_PK PRIMARY KEY (ZTXL_ID) USING INDEX TABLESPACE V8INDEX) TABLESPACE V8CONF;

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

COMMENT ON TABLE ZTXL IS 'Link between tax exemptions and exempted tax types for cases where several taxes are linked to a department code and not all should be comitted';

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

ALTER TABLE MMOD ADD ( MMOD_ZDCO_ID NUMBER(30) NULL  );

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

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

ALTER TABLE WFTP MODIFY ( WFTP_PASSWORD VARCHAR2(60));

ALTER TABLE WPHS MODIFY ( WPHS_MULTIV8PW VARCHAR2(60));

ALTER TABLE WPHS MODIFY ( WPHS_DBPW VARCHAR2(60));

ALTER TABLE WSPS MODIFY ( WSPS_PASSWORD VARCHAR2(60));

ALTER TABLE XCED MODIFY ( XCED_LEISUREPASSWORD VARCHAR2(60));

ALTER TABLE XJET MODIFY ( XJET_PASSWORD VARCHAR2(60));

ALTER TABLE XMTY ADD ( XMTY_WRXP_ID NUMBER(30) NULL  );

ALTER TABLE YCAD ADD ( YCAD_WPHS_ID NUMBER(30) NULL  );

ALTER TABLE YCAT ADD ( YCAT_TYPE NUMBER(1) DEFAULT 0 NOT NULL  );

ALTER TABLE YCEV ADD ( YCEV_MIN_ADVANCE_BOOKING_DAYS NUMBER(3) NULL  );

ALTER TABLE YDOR MODIFY ( YDOR_LONGDESC VARCHAR2(30));

ALTER TABLE YDOR ADD ( YDOR_SHORTDESC VARCHAR2(30) NULL  );

ALTER TABLE YDOR ADD ( YDOR_RELATION NUMBER(1) DEFAULT 0 NOT NULL  );

ALTER TABLE YDOR ADD ( YDOR_STATUS NUMBER(1) NULL  );

ALTER TABLE YGRP ADD ( YGRP_STATUS NUMBER(1) DEFAULT 0 NULL  );

ALTER TABLE YHAT ADD ( YHAT_MAXDEPCREDITS NUMBER(4) NULL  );

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

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

ALTER TABLE YRKP MODIFY ( YRKP_PIN VARCHAR2(50));

ALTER TABLE YRMS ADD ( YRMS_BED_YCAT_ID NUMBER(30) NULL  );

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

ALTER TABLE YRSC ADD ( YRSC_ROLE NUMBER(1) NULL  );

ALTER TABLE YRSC ADD ( YRSC_DEFAULT_YRSR_ID NUMBER(10) NULL  );

ALTER TABLE YRST ADD ( YRST_YRES_ID NUMBER(30) NULL  );

ALTER TABLE ZDCO ADD (ZDCO_POSTTAXONLY number(1));

ALTER TABLE ZDCO ADD (ZDCO_REBATE_ZDCO_ID number(30));

ALTER TABLE ZINV ADD (ZINV_NUMBER2 varchar2(60 char), ZINV_EMAIL varchar2(100 char));

ALTER TABLE ZFAG ADD (ZFAG_NOEARCHIVE number(1));

ALTER TABLE SFOR MODIFY SFOR_GUESTNAME VARCHAR2(60 CHAR);

ALTER TABLE WATY ADD WATY_ROOMCLEANING number(1);

DELETE FROM XREM WHERE XREM_LEVEL = 'GOLD ELITE';

UPDATE XCED SET XCED_MAXSESSIONS=0 WHERE XCED_MAXSESSIONS IS NULL;

COMMENT ON COLUMN YCAT.YCAT_TYPE IS '0=Room Only Room 1=Bed Only Room 2=Mixed: Room and Bed Room 3=Bed (not room)';

COMMENT ON COLUMN YRMS.YRMS_BED_YCAT_ID IS 'Bed type: Links to a ycat_type=3 Bed type if hotel does not identify beds individually in ybed. Otherwise not used.';

COMMENT ON COLUMN YCAD.YCAD_WPHS_ID IS 'Non Operated Rooms Management: link hotel segment to partner hotel'; 

COMMENT ON COLUMN YGRP.YGRP_STATUS IS 'to indicate group is closed down for any future modification, 0 = open , 1 = closed';

COMMENT ON COLUMN YRCH.YRCH_BWBLOCKRATE IS 'flag to indicate internal rate used only by Best western group functionality. These rates are not visible in the pms system for normal rate operations';

COMMENT ON COLUMN YRMS.YRMS_HSKFLAG IS '0 - Default | 1 - Room is dirty+vacant after previous departure (c/o in the past, not today) |  2 - Room is dirty+vacant after OOO/OOS status change';

COMMENT ON COLUMN ZINV.ZINV_NUMBER2 IS 'Storage for a secondary invoice number, introduced for the Turkish E-Archive ETTN number';

COMMENT ON COLUMN ZINV.ZINV_EMAIL IS 'The email address for electronically delivered invoices';

COMMENT ON COLUMN ZINV.ZINV_FISCALINVOICE IS '1 = Turkey e-invoice, 4 = Turkey E-Archive not processed, 5 = Turkey E-Archive processed';

COMMENT ON COLUMN ZDCO.ZDCO_REBATE_ZDCO_ID IS 'Turkish rebate ZDCO_ID for voiding E-Archive';

COMMENT ON COLUMN ZFAG.ZFAG_NOEARCHIVE IS 'Don''t allow Turkish E-Archive for this account type';

COMMENT ON COLUMN MMOD.MMOD_BLOCK_INC_CANC IS 'indicates whether also blocks not affecting availability will be uploaded';

COMMENT ON COLUMN MMOD.MMOD_RATE_IGN_PCK IS 'indicates whether packages are add to rate upload xml';

COMMENT ON COLUMN ZDCO.ZDCO_POSTTAXONLY IS '1 = Indicates that this department code represents a technical department code, where all of the entered amount goes to the linked tax code';

COMMENT ON COLUMN XCLR.XCLR_LEVEL IS '0 - parents/childs; 1 - grandparents/grandchilds';

COMMENT ON COLUMN XCLR.XCLR_TYPE IS '1-Spouse, 2-next geneneration (descendant), 3-prev gen (predecessor), 4-siblings, 5-partners, 6-Relative, 7-Distant Relative | for parents should be 3, for children 2';

COMMENT ON COLUMN MMOD.MMOD_USE_NEW_BLOCK_HANDLING IS 'indicates for Best Western whether the new group handling is in place';

COMMENT ON TABLE YBCR IS 'Third party CRS id for block';

COMMENT ON TABLE YBBW IS 'Best Western specifc block data';

CREATE TABLE WBWC (
    WBWC_ID NUMBER(30) NOT NULL
   ,WBWC_LONGDESC VARCHAR2(30) NOT NULL
   ,WBWC_NAME_SEP VARCHAR2(1)
   ,WBWC_ENDOFTRACK_SEP varchar2(1)
   ,WBWC_TRACK2START_SEP varchar2(1)
   ,WBWC_SWIPESPEED number(4)
   ,CONSTRAINT WBWC_PK PRIMARY KEY (WBWC_ID) USING INDEX TABLESPACE V8INDEX) TABLESPACE V8cONF;

COMMENT ON TABLE WBWC IS 'Swiper config for Best Western Membership Cards';

COMMENT ON COLUMN WBWC.WBWC_ID IS 'Id of bw swiper';

COMMENT ON COLUMN WBWC.WBWC_LONGDESC IS 'Name of bw swiper';

COMMENT ON COLUMN WBWC.WBWC_NAME_SEP IS 'Name separator';

COMMENT ON COLUMN WBWC.WBWC_ENDOFTRACK_SEP IS 'End of track separator';

COMMENT ON COLUMN WBWC.WBWC_TRACK2START_SEP IS 'Track 2 start separator';

COMMENT ON COLUMN WBWC.WBWC_SWIPESPEED IS 'Swipe speed';

ALTER TABLE WPCA ADD WPCA_WBWC_ID NUMBER(30);

COMMENT ON TABLE WPRT IS 'Holds the protected data';

ALTER TABLE YFAL ADD YFAL_FROM_ZFAC_ID NUMBER(30);

COMMENT ON COLUMN YFAL.YFAL_FROM_ZFAC_ID IS 'to be able to link zfac to zfac. This will be the originator accounts id';

ALTER TABLE XPRG MODIFY XPRG_NEXTLOYALLEVEL VARCHAR2(15);


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


/*  RRER  */

CREATE UNIQUE INDEX RRER_YRES_RRES ON RRER
	(
	  RRER_RRES_ID
	 ,RRER_YRES_ID
	)
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
;



/*  XCMG  */

CREATE UNIQUE INDEX XCMG_XCMS_GLOBALID ON XCMG
	(
	  XCMG_CRSTYPE
	 ,XCMG_GLOBALID
	)
	PCTFREE    10
	INITRANS   2
	MAXTRANS   255
	TABLESPACE V8INDEX
;


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


CREATE SEQUENCE SEQ_WPRT INCREMENT BY 1 START WITH 1001 NOMAXVALUE MINVALUE 1 NOCYCLE NOCACHE NOORDER;
CREATE SEQUENCE SEQ_YBBW INCREMENT BY 1 START WITH 1001 NOMAXVALUE MINVALUE 1 NOCYCLE NOCACHE NOORDER;
CREATE SEQUENCE SEQ_YBCR INCREMENT BY 1 START WITH 1001 NOMAXVALUE MINVALUE 1 NOCYCLE NOCACHE NOORDER;
CREATE SEQUENCE SEQ_YRRR INCREMENT BY 1 START WITH 1001 NOMAXVALUE MINVALUE 1 NOCYCLE NOCACHE NOORDER;
CREATE SEQUENCE SEQ_WBWC INCREMENT BY 1 START WITH 1000 NOMAXVALUE NOCYCLE NOCACHE NOORDER;






--- End of DBDiff for Oracle --- Elapsed Time: 00:26:59 ---

