--UPDATE FROM 8.9.6.1 TO 8.9.6.2


DROP TABLE VERSION_8_9_6_1;


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

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);
