--UPDATE FROM 8.9.4.4 TO 8.9.4.5


DROP TABLE VERSION_8_9_4_4;



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


ALTER TABLE YCAD ADD YCAD_THIRDPARTYID VARCHAR2(30);

ALTER TABLE WNAE ADD WNAE_PARAMETERS VARCHAR2(1000);

CREATE TABLE WPER (
    WPER_ID NUMBER(30,0) NOT NULL
   ,WPER_USER_IDENTIFIER VARCHAR2(300) NOT NULL
   ,WPER_DATA CLOB
   ,WPER_TIMESTAMP DATE
   ,WPER_EXPIRED DATE
   ,CONSTRAINT WPER_PK PRIMARY KEY (WPER_ID) USING INDEX TABLESPACE V8INDEX
   ,CONSTRAINT WPER_IDENTIFIER UNIQUE (WPER_USER_IDENTIFIER) USING INDEX TABLESPACE V8INDEX
) TABLESPACE V8LARGE; 
   
CREATE SEQUENCE SEQ_WPER INCREMENT BY 1 START WITH 1000 NOMAXVALUE NOCYCLE NOCACHE NOORDER;

COMMENT ON TABLE WPER  IS 'Persistent storage';

INSERT INTO ZORG SELECT SEQ_ZORG.NEXTVAL ZORG_ID, ZPOS_ID ZORG_ZPOS_ID, 4 ZORG_ROLE, ZPOS_ZDCO_ID ZORG_TABLE_ID FROM ZPOS WHERE NOT EXISTS (SELECT 1 FROM ZORG WHERE ZORG_ZPOS_ID=ZPOS_ID) AND ZPOS.ZPOS_CDT<>2;

ALTER TABLE WLCK ADD WLCK_TABLENAME VARCHAR2(4);
