--UPDATE FROM 8.7.4.5 TO 8.7.4.6


DROP TABLE VERSION_8_7_4_5;



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

CREATE TABLE YPOL (
    YPOL_ID NUMBER(30) NOT NULL
   ,YPOL_STATUS NUMBER(1) NOT NULL
   ,YPOL_YRES_ID NUMBER(30) NOT NULL
   ,YPOL_TYPE NUMBER(1) NOT NULL
   ,YPOL_RESPONSE VARCHAR2(20)
   ,YPOL_TIMESTAMP DATE NOT NULL
   ,YPOL_EXPORTTEXT VARCHAR2(270)
   ,YPOL_EXPORTTIME DATE
   ,YPOL_IMPORTTIME DATE
   ,YPOL_INCOMPLETE NUMBER(1)
   ,CONSTRAINT YPOL_PK PRIMARY KEY (YPOL_ID) USING INDEX TABLESPACE V8INDEX) TABLESPACE V8MAIN;

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

COMMENT ON TABLE YPOL IS 'police export triggers';

COMMENT ON COLUMN YPOL.YPOL_TYPE IS '0=new reservation 1=modified reservation';

COMMENT ON COLUMN YPOL.YPOL_STATUS IS '0=New, not sent yet 1=Sent 2=responce received 3=error 4=not needed to send';

COMMENT ON COLUMN YPOL.YPOL_RESPONSE IS 'response received from police. can be an error message';

COMMENT ON COLUMN YPOL.YPOL_TIMESTAMP IS 'timestamp of the ypol record';

ALTER TABLE YRES ADD YRES_POLICEEXPORT NUMBER(1);

COMMENT ON COLUMN YRES.YRES_POLICEEXPORT IS '0=no export necessary 1=export to ypol is needed 2=export to ypol was performed';

ALTER TABLE PSEC ADD PSEC_AUTOOUT_PSAC_ID NUMBER(30);

ALTER TABLE PRIC ADD PRIC_CALCTYPE NUMBER(1);

COMMENT ON COLUMN PRIC.PRIC_CALCTYPE IS '1 - if the price should be reposted after the set amount of minutes (pcad) has passed';
