--UPDATE FROM 8.8.2.0 TO 8.8.2.1


DROP TABLE VERSION_8_8_2_0;



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


CREATE TABLE WEDA (
   WEDA_ID NUMBER(30) NOT NULL
  ,WEDA_ROLE NUMBER(1) NOT NULL
  ,WEDA_FILEPATH VARCHAR2(400) NOT NULL
  ,CONSTRAINT WEDA_PK PRIMARY KEY (WEDA_ID) USING INDEX TABLESPACE V8INDEX
) TABLESPACE V8CONF;

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

COMMENT ON TABLE WEDA IS 'Email Default attachments per role';

COMMENT ON COLUMN WEDA.WEDA_ROLE IS '1=Profiles|2=Tasks+Activities|3=PMS|4=CCM'; 

ALTER TABLE WUSS MODIFY WUSS_NAME VARCHAR2(200);

ALTER TABLE ZPOS ADD ZPOS_DEPOSIT_ZINV_ID NUMBER(30);

COMMENT ON COLUMN ZPOS.ZPOS_DEPOSIT_ZINV_ID IS 'Reference to ZINV_ID of the deposit invoice (using enhanced deposit handling)';

ALTER TABLE YBLH ADD YBLH_AUTOGROUP NUMBER(1);

ALTER TABLE YGRP ADD YGRP_BLOCK_DEFAULT NUMBER(1) DEFAULT 0;

COMMENT ON COLUMN YGRP.YGRP_BLOCK_DEFAULT IS '1 - default group of linked block in case yblh_autogroup = 1';

COMMENT ON COLUMN WEDA.WEDA_ROLE IS '1=Profiles|2=Tasks+Activities|3=Reservation|4=CCM|5=A/R|6=Maintenance|7=Table Reservation';

ALTER TABLE XSCD ADD XSCD_FILENAMEMASK VARCHAR2(200);

CREATE TABLE ZYTT (
    ZYTT_ID NUMBER(30) NOT NULL
   ,ZYTT_SHORTDESC VARCHAR2(3 CHAR) NOT NULL
   ,ZYTT_LONGDESC VARCHAR2(30 CHAR) 
   ,ZYTT_DISPLORDER NUMBER(3) 
   ,ZYTT_INACTIVE NUMBER(1) 
   ,ZYTT_DEFAULT NUMBER(1) 
   ,ZYTT_FROMNUMBER VARCHAR2(6 CHAR) 
   ,ZYTT_TONUMBER VARCHAR2(6 CHAR) 
   ,CONSTRAINT ZYTT_PK PRIMARY KEY (ZYTT_ID) USING INDEX TABLESPACE V8INDEX) TABLESPACE V8CONF;

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

COMMENT ON TABLE ZYTT IS 'Config of TI yearly tickets';

COMMENT ON COLUMN ZYTT.ZYTT_FROMNUMBER IS 'start of the card number range';

COMMENT ON COLUMN ZYTT.ZYTT_TONUMBER IS 'end of the card number range';

CREATE TABLE ZYPC (
    ZYPC_ID NUMBER(30) NOT NULL
   ,ZYPC_SHORTDESC VARCHAR2(3 CHAR) NOT NULL
   ,ZYPC_LONGDESC VARCHAR2(30 CHAR) 
   ,ZYPC_DISPLORDER NUMBER(3) 
   ,ZYPC_INACTIVE NUMBER(1) 
   ,ZYPC_DEFAULT NUMBER(1) 
   ,CONSTRAINT ZYPC_PK PRIMARY KEY (ZYPC_ID) USING INDEX TABLESPACE V8INDEX) TABLESPACE V8CONF;

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

COMMENT ON TABLE ZYPC IS 'Config of TI yearly tickets payment cycles';

CREATE TABLE ZYTX (
    ZYTX_ID NUMBER(30) NOT NULL
   ,ZYTX_ZYTT_ID NUMBER(30) NOT NULL
   ,ZYTX_ZYPC_ID NUMBER(30) NOT NULL
   ,ZYTX_ZTRA_ID NUMBER(30) NOT NULL
   ,ZYTX_VALIDFROM DATE
   ,ZYTX_VALIDUNTIL DATE
   ,ZYTX_GUEST_XCMS_ID NUMBER(30) NOT NULL
   ,ZYTX_CONTRACTPARTNER_XCMS_ID NUMBER(30) NOT NULL
   ,ZYTX_SALESCONTACT_XCMS_ID NUMBER(30) NOT NULL
   ,ZYTX_INACTIVE NUMBER(1) 
   ,ZYTX_INACTIVE_REASON VARCHAR2(200 CHAR)
   ,ZYTX_CANCELDATE DATE
   ,ZYTX_CANCEL_REASON VARCHAR2(200 CHAR)
   ,CONSTRAINT ZYTX_PK PRIMARY KEY (ZYTX_ID) USING INDEX TABLESPACE V8INDEX) TABLESPACE V8CONF;

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

COMMENT ON TABLE ZYTX IS 'TI yearly tickets';

COMMENT ON COLUMN ZYTX.ZYTX_GUEST_XCMS_ID IS 'link to guest profile';

COMMENT ON COLUMN ZYTX.ZYTX_CONTRACTPARTNER_XCMS_ID IS 'link to contract partner profile';

COMMENT ON COLUMN ZYTX.ZYTX_SALESCONTACT_XCMS_ID IS 'link to sales contact profile';

CREATE TABLE ZYZF (
    ZYZF_ID NUMBER(30) NOT NULL
   ,ZYZF_ZYTX_ID NUMBER(30) NOT NULL
   ,ZYZF_ZFAC_ID NUMBER(30) NOT NULL
   ,CONSTRAINT ZYZF_PK PRIMARY KEY (ZYZF_ID) USING INDEX TABLESPACE V8INDEX) TABLESPACE V8CONF;

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

COMMENT ON TABLE ZYZF IS 'Link table between ZYTX and ZFAC to identify transponders used with one yearly ticket';

CREATE TABLE ZYTG (
    ZYTG_ID NUMBER(30) NOT NULL
   ,ZYTG_SHORTDESC VARCHAR2(3 CHAR) NOT NULL
   ,ZYTG_LONGDESC VARCHAR2(30 CHAR) 
   ,ZYTG_DISPLORDER NUMBER(3) 
   ,ZYTG_ROLE NUMBER(3) 
   ,CONSTRAINT ZYTG_PK PRIMARY KEY (ZYTG_ID) USING INDEX TABLESPACE V8INDEX) TABLESPACE V8CONF;

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

COMMENT ON TABLE ZYTG IS 'Yearly Ticket Groups for Tropical Islands';

COMMENT ON COLUMN ZYTG.ZYTG_ROLE IS '0 - No role, 1 - Yearly Tickets'; 

ALTER TABLE PTIK ADD PTIK_ZYTG_ID NUMBER(30);

COMMENT ON COLUMN PTIK.PTIK_ZYTG_ID IS 'Link to Ticket groups'; 
