--UPDATE FROM 8.8.3.0 TO 8.8.4.0


DROP TABLE VERSION_8_8_3_0;



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


ALTER TABLE ZADR MODIFY ZADR_CITY VARCHAR2(60);

UPDATE YFSR SET YFSR_VALUE='0' WHERE yfsr_value='-1';

ALTER TABLE WMAI ADD WMAI_DRAFT NUMBER(1);

COMMENT ON COLUMN WMAI.WMAI_DRAFT IS 'The email saved for future editing';

ALTER TABLE WMAI MODIFY WMAI_TO NULL;

ALTER TABLE WMAI MODIFY WMAI_SUBJECT NULL;

ALTER TABLE PTIK ADD PTIK_INTERFACEACCESSCODE VARCHAR2(10);

COMMENT ON COLUMN PTIK.PTIK_INTERFACEACCESSCODE IS 'Interface Access Code Value';

ALTER TABLE WQNR MODIFY WQNR_LONGDESC VARCHAR2 (60);

CREATE TABLE WQUG (
  WQUG_ID NUMBER (30) NOT NULL,
  WQUG_SHORTDESC VARCHAR2 (10),
  WQUG_LONGDESC VARCHAR2 (30),
  WQUG_DISPLORDER NUMBER(3),
  WQUG_INACTIVE NUMBER(1),
CONSTRAINT WQUG_PK PRIMARY KEY (WQUG_ID) USING INDEX TABLESPACE V8INDEX) TABLESPACE V8CONF;

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

COMMENT ON TABLE WQUG IS 'Question Groups';

ALTER TABLE WQNL ADD WQNL_WQUG_ID NUMBER (30);

ALTER TABLE QNRA ADD QNRA_WQNL_ID NUMBER (30);

ALTER TABLE WQNL ADD WQNL_GROUPORDER NUMBER (4);

COMMENT ON COLUMN WQNL.WQNL_GROUPORDER IS 'Displayorder of the Question groups';

ALTER TABLE QNRA ADD QNRA_WQNL_ID NUMBER(30);

COMMENT ON COLUMN QNRA.QNRA_WQNL_ID IS 'Answer link to questionare';

UPDATE QNRA SET QNRA_WQNL_ID=(SELECT WQNL_ID FROM WQNL, WQNR, QNRA A, QNRF WHERE A.QNRA_QNRF_ID=QNRF_ID AND QNRF_WQNR_ID=WQNR_ID AND WQNL_WQNR_ID=WQNR_ID AND WQNL_WQUE_ID=A.QNRA_WQUE_ID AND QNRA.QNRA_ID=A.QNRA_ID), QNRA_WQUE_ID=NULL WHERE QNRA_WQUE_ID IS NOT NULL;

ALTER TABLE YPKG MODIFY YPKG_SHORTDESC VARCHAR2(4);

ALTER TABLE WPCA ADD WPCA_PMS_LAST_VERSION VARCHAR2 (15);

COMMENT ON COLUMN WPCA.WPCA_PMS_LAST_VERSION Is 'last PMS Version used on this workstation';
 
ALTER TABLE PTIK ADD PTIK_TICKETCREATIONLEVEL NUMBER(3);

COMMENT ON COLUMN PTIK.PTIK_TICKETCREATIONLEVEL IS 'Ticket Creation Level';

ALTER TABLE XCED ADD XCED_TICKETCREATIONLEVEL NUMBER(3);

COMMENT ON COLUMN XCED.XCED_TICKETCREATIONLEVEL IS 'Ticket Creation Level, will be compared to the ticket''s level on creating a new transponder';

ALTER TABLE PTIK ADD (PTIK_EXCLUSIVE_XCMS_ID NUMBER(30), PTIK_EXCLUSIVE_PAYMENT_ZDCO_ID NUMBER(30));

COMMENT ON COLUMN PTIK.PTIK_EXCLUSIVE_XCMS_ID IS 'Ticket Checkout Limitations, if set, the ticket can only be checked out to this profile';

COMMENT ON COLUMN PTIK.PTIK_EXCLUSIVE_PAYMENT_ZDCO_ID IS 'Ticket Checkout Limitations, if set, the ticket can only be checked out using this payment department code';

ALTER TABLE YRCH MODIFY YRCH_WEBINFO VARCHAR2(2000);

ALTER TABLE XPAC ADD XPAC_WEBENABLED NUMBER(1);

COMMENT ON COLUMN XPAC.XPAC_WEBENABLED IS 'flag to include this category in suite8 Homepage';

ALTER TABLE XPDA ADD XPDA_WEBENABLED NUMBER(1);

COMMENT ON COLUMN XPDA.XPDA_WEBENABLED IS 'flag to include this attribute in suite8 Homepage';

ALTER TABLE MMOD ADD MMOD_HTTP_URL2 VARCHAR2(100);

COMMENT ON COLUMN MMOD.MMOD_HTTP_URL2 IS '3rd URL used by Expedia for booking Confirmation reqeust';

ALTER TABLE MQU4 ADD MQU4_RESEND NUMBER(1,0);

COMMENT ON COLUMN MQU4.MQU4_RESEND IS 'Indicates whether message could not yet be sent';

ALTER TABLE PTIK ADD PTIK_DONT_SEND_IFC NUMBER(1);

COMMENT ON COLUMN PTIK.PTIK_DONT_SEND_IFC IS '1. do not send Key interface commands for this Ticket type';

ALTER TABLE ZDCO ADD ZDCO_COMMENTDISABLED NUMERIC(1) DEFAULT 0;

COMMENT ON COLUMN ZDCO.ZDCO_COMMENTDISABLED IS '0 = ZPOS_COMMENT shown on invoice, 1 = ZPOS_COMMENT hidden on invoice';

DELETE FROM WUSS WHERE WUSS.WUSS_NAME LIKE 'infofolioonlyonce';

ALTER TABLE YEBR ADD YEBR_NOOFPAX NUMBER(1) DEFAULT 0;

COMMENT ON COLUMN YEBR.YEBR_NOOFPAX IS 'Per Person 1=Yes';

UPDATE YEBR SET YEBR_NOOFPAX=(SELECT YCIT_NOOFPAX FROM YCIT WHERE YCIT_ID=YEBR_YCIT_ID) WHERE YEBR_ID IN ( SELECT YEBR_ID  FROM YEBR, YEVM, YCIT  WHERE YEBR_YEVM_ID=YEVM_ID AND YEBR_YCIT_ID=YCIT_ID AND NVL(YCIT_NOOFPAX, 0)=1 AND YEVM_NOOFATTENDEES = YEBR_QUANTITY);

ALTER TABLE MCFG ADD MCFG_SVC_MAX_MEM NUMBER(4,0);

COMMENT ON COLUMN MCFG.MCFG_SVC_MAX_MEM IS 'Indicates the maximum memory amount a service can use before the monitor restarts the service';

ALTER TABLE MCFG ADD MCFG_MON_LOGLEVEL NUMBER(1,0);

COMMENT ON COLUMN MCFG.MCFG_MON_LOGLEVEL IS 'logging level for the interface monitor';

ALTER TABLE YPKD ADD YPKD_DISPLORDER NUMBER(30);

COMMENT ON COLUMN YPKD.YPKD_DISPLORDER IS 'Package display order';

ALTER TABLE YETB ADD YETB_DISPLORDER NUMBER(30);

COMMENT ON COLUMN YETB.YETB_DISPLORDER IS 'Event group display order';

ALTER TABLE YHAC MODIFY YHAC_COMMENT VARCHAR2(4000 CHAR);

CREATE TABLE WIML(
  WIML_ID           NUMBER(30)                  NOT NULL,
  WIML_TABLENAME    CHAR(4 BYTE)                NOT NULL,
  WIML_TABLEID      NUMBER(30)                  NOT NULL,
  WIML_DESCRIPTION  VARCHAR2(60 BYTE),
  WIML_IMAGETYPE    NUMBER(1)                   NOT NULL,
  WIML_WIMG_ID      NUMBER(30)                  NOT NULL,
  WIML_WEBENABLED   NUMBER(1),
  CONSTRAINT WIML_PK PRIMARY KEY (WIML_ID) USING INDEX TABLESPACE V8INDEX) TABLESPACE V8MAIN;

COMMENT ON TABLE WIML IS 'Tables and Images Link Table'; 

COMMENT ON COLUMN WIML.WIML_ID IS 'WIML ID';

COMMENT ON COLUMN WIML.WIML_TABLENAME IS 'Linked Table Name';

COMMENT ON COLUMN WIML.WIML_TABLEID IS 'Record id from the linked table';

COMMENT ON COLUMN WIML.WIML_IMAGETYPE  IS '0.Web Picture,  1.Mobile Device Picture, 2.Thumbnail';

COMMENT ON COLUMN WIML.WIML_WIMG_ID  IS 'Linked image id';

COMMENT ON COLUMN WIML.WIML_WEBENABLED  IS '1. available in web';

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

ALTER TABLE YCET ADD YCET_WEBENABLED NUMBER(1);

ALTER TABLE YCEV ADD YCEV_WEBENABLED NUMBER(1);

ALTER TABLE YCEV ADD YCEV_SHORTWEBINFO VARCHAR2(1000);

ALTER TABLE YCEV ADD YCEV_LONGWEBINFO VARCHAR2(2000);

ALTER TABLE YCEV ADD YCEV_MD_SHORTWEBINFO VARCHAR2(1000);

ALTER TABLE YCEV ADD YCEV_MD_LONGWEBINFO VARCHAR2(2000);

COMMENT ON COLUMN YCEV.YCEV_SHORTWEBINFO  IS 'Web Short Information';

COMMENT ON COLUMN YCEV.YCEV_LONGWEBINFO  IS 'Web Long Information';

COMMENT ON COLUMN YCEV.YCEV_MD_SHORTWEBINFO  IS 'Web Short Information for Mobile Device';

COMMENT ON COLUMN YCEV.YCEV_MD_LONGWEBINFO  IS 'Web Long Information for Mobile Device';

ALTER TABLE YCAT ADD YCAT_LONGWEBINFO VARCHAR2(2000);

ALTER TABLE YCAT ADD YCAT_MD_SHORTWEBINFO VARCHAR2(1000);

ALTER TABLE YCAT ADD YCAT_MD_LONGWEBINFO VARCHAR2(2000);

ALTER TABLE YCAT ADD YCAT_EXTENDEDWEBINFO VARCHAR2(2000);

ALTER TABLE YCAT ADD YCAT_MD_EXTENDEDWEBINFO VARCHAR2(2000);

COMMENT ON COLUMN YCAT.YCAT_SHORTWEBINFO  IS 'Web Short Information';

COMMENT ON COLUMN YCAT.YCAT_LONGWEBINFO  IS 'Web Long Information';

COMMENT ON COLUMN YCAT.YCAT_MD_SHORTWEBINFO  IS 'Web Short Information for Mobile Device';

COMMENT ON COLUMN YCAT.YCAT_MD_LONGWEBINFO  IS 'Web Long Information for Mobile Device';

COMMENT ON COLUMN YCAT.YCAT_EXTENDEDWEBINFO IS 'Extended Web Information';

COMMENT ON COLUMN YCAT.YCAT_MD_EXTENDEDWEBINFO IS 'Extended Web Information for Mobile Device';

ALTER TABLE YRCH ADD YRCH_LONGWEBINFO VARCHAR2(2000);

ALTER TABLE YRCH ADD YRCH_MD_SHORTWEBINFO VARCHAR2(1000);

ALTER TABLE YRCH ADD YRCH_MD_LONGWEBINFO VARCHAR2(2000);

COMMENT ON COLUMN YRCH.YRCH_WEBINFO  IS 'Web Short Information';

COMMENT ON COLUMN YRCH.YRCH_LongWEBINFO  IS 'Web Long Information';

COMMENT ON COLUMN YRCH.YRCH_MD_SHORTWEBINFO  IS 'Web Short Information for Mobile Device';

COMMENT ON COLUMN YRCH.YRCH_MD_LONGWEBINFO  IS 'Web Long Information for Mobile Device';

ALTER TABLE YPAC ADD YPAC_LONGWEBINFO VARCHAR2(2000);

ALTER TABLE YPAC ADD YPAC_MD_SHORTWEBINFO VARCHAR2(1000);

ALTER TABLE YPAC ADD YPAC_MD_LONGWEBINFO VARCHAR2(2000);

COMMENT ON COLUMN YPAC.YPAC_WEBINFO  IS 'Web Short Information';

COMMENT ON COLUMN YPAC.YPAC_LongWEBINFO  IS 'Web Long Information';

COMMENT ON COLUMN YPAC.YPAC_MD_SHORTWEBINFO  IS 'Web Short Information for Mobile Device';

COMMENT ON COLUMN YPAC.YPAC_MD_LONGWEBINFO  IS 'Web Long Information for Mobile Device';

ALTER TABLE YPFR ADD YPFR_SHORTWEBINFO VARCHAR2(1000);

ALTER TABLE YPFR ADD YPFR_MD_SHORTWEBINFO VARCHAR2(1000);

COMMENT ON COLUMN YPFR.YPFR_SHORTWEBINFO  IS 'Web Information';

COMMENT ON COLUMN YPFR.YPFR_MD_SHORTWEBINFO IS 'Web Information for Mobile Device';

ALTER TABLE CART ADD 
(
  CART_WEBENABLED NUMBER(1),
  CART_WEBNAME VARCHAR2(60),
  CART_WEBSHORTDESCRIPTION VARCHAR2(300) ,
  CART_WEBLONGDESCRIPTION VARCHAR2(2000),
  CART_WIMG_ID NUMBER(30)
);

ALTER TABLE CART ADD CART_VOUCHERTYPE NUMBER(1);

COMMENT ON COLUMN CART.CART_VOUCHERTYPE IS '0 - Product voucher; 1 - Value Voucher; 2 - Arrangement voucher';

ALTER TABLE COUP ADD COUP_VOUCHERTYPE NUMBER(1);

COMMENT ON COLUMN COUP.COUP_VOUCHERTYPE IS '0 - Product voucher; 1 - Value Voucher; 2 - Arrangement voucher';

ALTER TABLE COUP ADD COUP_YRES_ID NUMBER(30);

COMMENT ON COLUMN COUP.COUP_YRES_ID IS 'Reservation link for Arrangement vouchers';

UPDATE CART SET CART_VOUCHERTYPE = CART_ISVALUECOUPON;

UPDATE COUP SET COUP_VOUCHERTYPE = Coup_ISVALUECOUPON;

ALTER TABLE CART DROP COLUMN CART_ISVALUECOUPON;

ALTER TABLE COUP DROP COLUMN COUP_ISVALUECOUPON;

ALTER TABLE COUP ADD COUP_FINALIZED NUMBER(1);

COMMENT ON COLUMN COUP.COUP_FINALIZED IS 'When 1, Arrangement voucher reservation cannot be edited anymore';

CREATE TABLE WLOP (
    WLOP_ID NUMBER(30) NOT NULL,
    WLOP_DATE DATE NOT NULL,
    WLOP_TYPE NUMBER(1) NOT NULL,
    WLOP_SUCCESS NUMBER(1) NOT NULL,
    WLOP_APPROVALNUMBER VARCHAR2(100),
    WLOP_MESSAGE VARCHAR2(3000),
    CONSTRAINT WLOP_PK PRIMARY KEY (WLOP_ID) USING INDEX TABLESPACE V8INDEX) TABLESPACE V8LARGE;

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

COMMENT ON TABLE WLOP IS 'Online payments log';

COMMENT ON COLUMN WLOP.WLOP_TYPE IS 'Payment system type. 1 = Telecash 2 = Paypal';

COMMENT ON COLUMN WLOP.WLOP_SUCCESS IS '1 = success 0 = failure';

COMMENT ON COLUMN WLOP.WLOP_APPROVALNUMBER IS 'Approval number from online payment system';

ALTER TABLE COUP ADD COUP_WLOP_ID NUMBER(30);

ALTER TABLE CART ADD CART_YRES_ID NUMBER(30);

ALTER TABLE CART ADD CART_COMPLIMENTARY NUMBER(1);

COMMENT ON COLUMN CART.CART_COMPLIMENTARY IS '1 = complimentary voucher type';

ALTER TABLE COUP ADD COUP_ORDERING_XCMS_ID NUMBER(30);

ALTER TABLE COUP ADD COUP_INTERNAL_INFO VARCHAR2(1000);

ALTER TABLE COUP ADD COUP_ORDER_REASON VARCHAR2(100);

ALTER TABLE RTAB MODIFY RTAB_NUMBER NUMBER(4);

ALTER TABLE RTAB MODIFY RTAB_DISPLORDER NUMBER(4);

ALTER TABLE XPDA MODIFY XPDA_DISPLORDER NUMBER(4);

ALTER TABLE WTRL MODIFY WTRL_VALUE VARCHAR2(2000);

DELETE FROM XCCS WHERE XCCS_XCMS_ID IN (SELECT XCED_ID FROM XCED);

ALTER TABLE XJET ADD XJET_DELIVERYMETHOD NUMBER(1); 

COMMENT ON COLUMN XJET.XJET_DELIVERYMETHOD IS '0 = JetWeb DLL, 1 = HTTP, 2 = File Export';

ALTER TABLE XJET ADD XJET_EXPORTPATH VARCHAR(60);

ALTER TABLE XJET ADD XJET_EXPORTONEFILE NUMBER(1);

ALTER TABLE CART ADD CART_WEB_CUSTOMIZABLE NUMBER(1);

COMMENT ON COLUMN CART.CART_WEB_CUSTOMIZABLE IS '1 = some voucher conditions can be adjusted on the web';

ALTER TABLE YRCH MODIFY YRCH_RATEINFO VARCHAR2(2000); 

ALTER TABLE ZDCO ADD ZDCO_BANK_DEBITPAYMENT NUMBER(1);

COMMENT ON COLUMN ZDCO.ZDCO_BANK_DEBITPAYMENT IS 'Allow Direct Bank Debit Payment';

CREATE TABLE ZBDP (
    ZBDP_ID NUMBER(30) NOT NULL
   ,ZBDP_ACCOUNTNUMBER VARCHAR2(50) NOT NULL
   ,ZBDP_HOLDERNAME VARCHAR2(50) NOT NULL 
   ,ZBDP_BANKCODE VARCHAR2(20) NOT NULL 
   ,ZBDP_CARDNUMBER VARCHAR2(30)
   ,ZBDP_CARDEXPIRY VARCHAR2(4)
   ,ZBDP_SWIFTCODE VARCHAR2(30)
   ,ZBDP_ZPOS_ID NUMBER(30)	
   ,CONSTRAINT ZBDP_PK PRIMARY KEY (ZBDP_ID) USING INDEX TABLESPACE V8INDEX) TABLESPACE V8MAIN;

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

COMMENT ON TABLE ZBDP IS 'Bank Debit Payment Details';

COMMENT ON COLUMN ZBDP.ZBDP_ACCOUNTNUMBER IS 'Account number';

COMMENT ON COLUMN ZBDP.ZBDP_HOLDERNAME IS 'Account Holder Name';

COMMENT ON COLUMN ZBDP.ZBDP_BANKCODE IS 'Bank Identification number';

COMMENT ON COLUMN ZBDP.ZBDP_CARDNUMBER IS 'Account Debit Card Number';

COMMENT ON COLUMN ZBDP.ZBDP_CARDEXPIRY IS 'Debit Card Expiry Date';

COMMENT ON COLUMN ZBDP.ZBDP_SWIFTCODE IS 'Bank Swift Code';

COMMENT ON COLUMN ZBDP.ZBDP_ZPOS_ID IS 'linked ZPOS id';

CREATE TABLE YALT (
  YALT_ID NUMBER(30) NOT NULL,
  YALT_TABLELINKEDTO VARCHAR2(4),
  YALT_TABLE_ID NUMBER(30),
  YALT_ALTERNATIVE_ID NUMBER(30),
  CONSTRAINT YALT_PK PRIMARY KEY (YALT_ID) USING INDEX TABLESPACE V8INDEX) TABLESPACE V8MAIN;
  
COMMENT ON COLUMN YALT.YALT_ID IS 'ID';

COMMENT ON COLUMN YALT.YALT_TABLELINKEDTO IS 'YEBS, YEBR, YEMN, YEMI, YEVM, YPKD, YETB';

COMMENT ON COLUMN YALT.YALT_TABLE_ID IS 'ID to which alternatives are defined';

COMMENT ON COLUMN YALT.YALT_ALTERNATIVE_ID IS 'ID of alternative';
 
CREATE SEQUENCE SEQ_YALT INCREMENT BY 1 START WITH 1000 NOMAXVALUE NOCYCLE NOCACHE NOORDER;

ALTER TABLE YPKD ADD YPKD_ALTERNATIVE NUMERIC(1) DEFAULT 0;

ALTER TABLE YETB ADD YETB_ALTERNATIVE NUMERIC(1) DEFAULT 0;

ALTER TABLE YEVM ADD YEVM_ALTERNATIVE NUMERIC(1) DEFAULT 0;

ALTER TABLE YEBS ADD YEBS_ALTERNATIVE NUMERIC(1) DEFAULT 0;

ALTER TABLE YEBR ADD YEBR_ALTERNATIVE NUMERIC(1) DEFAULT 0;

ALTER TABLE YEMN ADD YEMN_ALTERNATIVE NUMERIC(1) DEFAULT 0;

ALTER TABLE YEMI ADD YEMI_ALTERNATIVE NUMERIC(1) DEFAULT 0;

ALTER TABLE YBEF ADD YBEF_ALTERNATIVE NUMBER(1);

ALTER TABLE WMAI ADD WMAI_BODY_SRC_WTXT_ID NUMBER(30);

COMMENT ON COLUMN YPKD.YPKD_ALTERNATIVE IS 'Alternative=1';

COMMENT ON COLUMN YETB.YETB_ALTERNATIVE IS 'Alternative=1';

COMMENT ON COLUMN YEVM.YEVM_ALTERNATIVE IS 'Alternative=1';

COMMENT ON COLUMN YEBS.YEBS_ALTERNATIVE IS 'Alternative=1';

COMMENT ON COLUMN YEBR.YEBR_ALTERNATIVE IS 'Alternative=1';

COMMENT ON COLUMN YEMN.YEMN_ALTERNATIVE IS 'Alternative=1';

COMMENT ON COLUMN YEMI.YEMI_ALTERNATIVE IS 'Alternative=1';

COMMENT ON COLUMN YBEF.YBEF_ALTERNATIVE IS 'Alternative=1';

UPDATE YBEF SET YBEF_ALTERNATIVE=0 WHERE NVL(YBEF_ALTERNATIVE, 0)<>1;

ALTER TABLE COUP ADD(COUP_ONHOLD NUMBER(1), COUP_ONHOLDREASON VARCHAR2(100));

CREATE TABLE SUPL (
    SUPL_ID NUMBER(30) NOT NULL,
    SUPL_TABLE_ID NUMBER(30) NOT NULL,
    SUPL_TABLENAME VARCHAR(4),
    CONSTRAINT SUPL_PK PRIMARY KEY (SUPL_ID) USING INDEX TABLESPACE V8INDEX
) TABLESPACE V8MAIN;

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

COMMENT ON TABLE SUPL IS 'track of the statistic tables records to be updated in master hotel';

ALTER TABLE RRER ADD RRER_YRES_ID1 NUMBER(30);

UPDATE RRER SET RRER_YRES_ID1=TO_NUMBER(RRER_YRES_ID);

ALTER TABLE RRER DROP COLUMN RRER_YRES_ID;

ALTER TABLE RRER RENAME COLUMN RRER_YRES_ID1 TO RRER_YRES_ID;

CREATE TABLE ZARG (
    ZARG_ID NUMBER(30) NOT NULL
   ,ZARG_SHORTDESC VARCHAR2(5 CHAR) NOT NULL 
   ,ZARG_LONGDESC VARCHAR2(30 CHAR) NOT NULL
   ,ZARG_DISPLORDER NUMBER(3)
   ,ZARG_WCOL_ID NUMBER(30)
   ,CONSTRAINT ZARG_PK PRIMARY KEY (ZARG_ID) USING INDEX TABLESPACE V8INDEX) TABLESPACE V8CONF;

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

COMMENT ON TABLE ZARG IS 'Article Groups';

ALTER TABLE ZART ADD ZART_ZARG_ID NUMBER(30);

ALTER TABLE ZART ADD ZART_SHORTDESC VARCHAR2(8 CHAR);

CREATE TABLE ZORG
(
  ZORG_ID                NUMBER(30)             NOT NULL,
  ZORG_ZPOS_ID           NUMBER(30)             NOT NULL,
  ZORG_ROLE              NUMBER(1),
  ZORG_TABLE_ID          NUMBER(30),
  CONSTRAINT ZORG_PK PRIMARY KEY (ZORG_ID) USING INDEX TABLESPACE V8INDEX) TABLESPACE V8MAIN;
  
COMMENT ON TABLE ZORG IS 'Store for posting origination to ease translation in reports';

COMMENT ON COLUMN ZORG.ZORG_ROLE IS '1/Rate Code Posting (YRCH), 2/Article Posting (ZART), 3/Package Posting (YPAC), 4/Department Code Posting (ZDCO)  ';

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

ALTER TABLE COUP RENAME COLUMN COUP_ORDERING_XCMS_ID TO COUP_CONSUMING_XCMS_ID;

COMMENT ON COLUMN COUP.COUP_XCMS_ID IS 'Ordering Profile';

COMMENT ON COLUMN COUP.COUP_CONSUMING_XCMS_ID IS 'Consuming Guest';

CREATE TABLE MURL
(
  MURL_ID                NUMBER(30)             NOT NULL,
  MURL_MMOD_ID           NUMBER(30)             NOT NULL,
  MURL_MSG_NAME          VARCHAR2(100 BYTE),
  MURL_URL               VARCHAR2(150 BYTE),
  MURL_DIRECTION         NUMBER(1),
  CONSTRAINT MURL_PK PRIMARY KEY (MURL_ID) USING INDEX TABLESPACE V8INDEX) TABLESPACE V8MAIN;

COMMENT ON COLUMN MURL.MURL_ID IS 'unique id';

COMMENT ON COLUMN MURL.MURL_MMOD_ID IS 'link to mmod';

COMMENT ON COLUMN MURL.MURL_MSG_NAME IS 'name of xml message';

COMMENT ON COLUMN MURL.MURL_URL IS 'URL used to send message';

COMMENT ON COLUMN MURL.MURL_DIRECTION IS 'direction of message 0 = download, 1 = upload';

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

CREATE TABLE MRTL
(
  MRTL_ID       NUMBER(30)                      NOT NULL,
  MRTL_MCNV_ID  NUMBER(30)                      NOT NULL,
  MRTL_YCAT_ID  NUMBER(30),
  MRTL_DISPLORDER NUMBER(3),
  MRTL_ZCNV_ID NUMBER(30),  
  CONSTRAINT MRTL_PK PRIMARY KEY (MRTL_ID) USING INDEX TABLESPACE V8INDEX) TABLESPACE V8CONF;

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

COMMENT ON COLUMN MRTL.MRTL_ID IS 'unique id';

COMMENT ON COLUMN MRTL.MRTL_MCNV_ID IS 'linkage to the master room type in mcnv';

COMMENT ON COLUMN MRTL.MRTL_YCAT_ID IS 'linkage to the linked room type in ycat';

COMMENT ON COLUMN MRTL.MRTL_DISPLORDER IS 'Selection order of roomtypes for availability check';

COMMENT ON COLUMN MRTL.MRTL_ZCNV_ID IS 'link to mapper used to select only unused roomtypes for linked list';

COMMENT ON COLUMN YRES.YRES_NOAVAILREASON IS ' Reason why not affecting availability.  1 = Waitlist  2 = Offer  3 = Canceled  4 = No Show  5 = Voucher Template   If the reservation status is 3 this field must be filled controlled by the business logic.';

ALTER TABLE COUP ADD COUP_SENDBYMAIL NUMBER(1);

COMMENT ON COLUMN COUP.COUP_SENDBYMAIL IS '1 - to be send, 2 - sent (0 or null, printed online)';

ALTER TABLE MMOD ADD MMOD_HTTP_RESEND_INTERVAL NUMBER(2);

COMMENT ON COLUMN MMOD.MMOD_HTTP_RESEND_INTERVAL IS 'resend interval in case URL is not available';

ALTER TABLE XCMT ADD XCMT_PHONEROLE NUMBER(1);

COMMENT ON COLUMN XCMT.XCMT_PHONEROLE IS '1 = Mobile phone';

ALTER TABLE CART ADD( 
   CART_LETTER_WRPT_ID NUMBER(30), 
   CART_VOUCHER_WRPT_ID NUMBER(30), 
   CART_ZINN_ID NUMBER(30), 
   CART_NUMBERTEMPLATE VARCHAR2(60));
 
ALTER TABLE COUP ADD (COUP_DEDICATION VARCHAR(4000), COUP_PICKUP_YRES_ID NUMBER(30));   

ALTER TABLE ZART ADD ZART_MANUALPRICE NUMBER(1);

COMMENT ON COLUMN ZART.ZART_MANUALPRICE IS 'allow the user to enter a price manually';

ALTER TABLE YEVM ADD YEVM_MERGEDTO_YEVM_ID NUMBER(30) DEFAULT 0;

COMMENT ON COLUMN YEVM.YEVM_MERGEDTO_YEVM_ID IS 'Package event id to which current package event gets merged';

ALTER TABLE YEBS ADD YEBS_MERGEDTO_YEBS_ID NUMBER(30) DEFAULT 0;

COMMENT ON COLUMN YEBS.YEBS_MERGEDTO_YEBS_ID IS 'Merged to function space ID';

ALTER TABLE YEBR ADD YEBR_MERGEDTO_YEBR_ID NUMBER(30) DEFAULT 0;

COMMENT ON COLUMN YEBR.YEBR_MERGEDTO_YEBR_ID IS 'Merged to catering item ID';

ALTER TABLE YEMN ADD YEMN_MERGEDTO_YEMN_ID NUMBER(30) DEFAULT 0;

COMMENT ON COLUMN YEMN.YEMN_MERGEDTO_YEMN_ID IS 'Merged to standard menu ID';

ALTER TABLE YEMI ADD YEMI_MERGEDTO_YEMI_ID NUMBER(30) DEFAULT 0;

COMMENT ON COLUMN YEMI.YEMI_MERGEDTO_YEMI_ID IS 'Merged to menu item ID';
