--UPDATE FROM 8.7.3.0 TO 8.7.3.1


DROP TABLE VERSION_8_7_3_0;



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


ALTER TABLE ZWTR ADD ZWTR_WPCA_ID NUMBER(30);

COMMENT ON COLUMN ZWTR.ZWTR_WPCA_ID IS 'ID of the terminal where the change has been made';

begin
DECLARE 
   cursor mapperlst is select mmod_id, mmod_vendor_id from mmod where mmod_vendor_id = 'ORS' or mmod_vendor_id = 'EXPED' order by mmod_id;
   cursor ratecodelst is select yrch_id, yrch_webenabled, yrch_zcur_id from yrch where yrch_webenabled = 1;

   fill mapperlst%rowtype;
   fill1 ratecodelst%rowtype; 
   begin
       for fill in mapperlst loop
          for fill1 in ratecodelst loop
            insert into mavl (mavl.MAVL_ID     , mavl.MAVL_MMOD_ID , mavl.MAVL_TYPE , mavl.MAVL_CODE_ID , mavl.MAVL_INACTIVE , mavl.MAVL_CUR_ID) 
            values           (seq_mavl.nextval , fill.mmod_id      , 'RC'           , fill1.yrch_id     , 0                  , fill1.yrch_zcur_id);
          end loop;
       end loop;
    
   end;
end;
/

CREATE TABLE YHAC (
   YHAC_ID NUMBER(30) NOT NULL
  ,YHAC_COMMENT VARCHAR2(200)
  ,CONSTRAINT YHAC_PK PRIMARY KEY (YHAC_ID) USING INDEX TABLESPACE V8INDEX) TABLESPACE V8CONF;
  
COMMENT ON TABLE YHAC IS 'Attendant comments';

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

ALTER TABLE YHRL ADD YHRL_YHAC_ID NUMBER(30);

ALTER TABLE MMOD ADD MMOD_FTP_PATH VARCHAR2(100);

COMMENT ON COLUMN MMOD.MMOD_FTP_PATH IS 'FTP path';

DELETE FROM WUSS WHERE WUSS_XCMS_ID=0 AND WUSS_NAME='DisplayDoubleOccupancy';

INSERT INTO WUSS (WUSS_ID,WUSS_XCMS_ID,WUSS_NAME,WUSS_VALUE) VALUES (SEQ_WUSS.NEXTVAL, 0, 'DisplayDoubleOccupancy', '1');

