diff --git a/src/db/migration/V20210429_1120__mantis22049.sql b/src/db/migration/V20210429_1120__mantis22049.sql index 057cf7c30..7aa732349 100644 --- a/src/db/migration/V20210429_1120__mantis22049.sql +++ b/src/db/migration/V20210429_1120__mantis22049.sql @@ -125,7 +125,6 @@ begin FECMODIF DATE, USUARIO_ID NUMBER(7,0), PRIMARY KEY (CONEXIONRUTATIPOPTOVTA_ID) ENABLE, - FOREIGN KEY (CONEXIONRUTACTRL_ID) REFERENCES CONEXION_RUTA_CTRL (CONEXIONRUTACTRL_ID), FOREIGN KEY (TIPOPTOVTA_ID) REFERENCES TIPO_PTOVTA (TIPOPTOVTA_ID) )'; exception when object_exists then null; @@ -155,7 +154,6 @@ begin FECMODIF DATE, USUARIO_ID NUMBER(7,0), PRIMARY KEY (CONEXIONRUTAPTOVTA_ID) ENABLE, - FOREIGN KEY (CONEXIONRUTACTRL_ID) REFERENCES CONEXION_RUTA_CTRL (CONEXIONRUTACTRL_ID), FOREIGN KEY (PUNTOVENTA_ID) REFERENCES PUNTO_VENTA (PUNTOVENTA_ID) )'; exception when object_exists then null; diff --git a/src/db/migration/V20221121_1120__mantis22352.sql b/src/db/migration/V20221121_1120__mantis22352.sql new file mode 100644 index 000000000..c6ff5c2dc --- /dev/null +++ b/src/db/migration/V20221121_1120__mantis22352.sql @@ -0,0 +1,122 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate +'CREATE TABLE CONEXION_RUTA_CONF + (CONEXIONRUTACONF_ID NUMBER(7,0) NOT NULL ENABLE, + ACTIVO NUMBER(1,0), + FECMODIF DATE, + USUARIO_ID NUMBER(7,0), + DESCRICAO VARCHAR2(100) BYTE, + PRIMARY KEY (CONEXIONRUTACONF_ID) ENABLE + )'; + exception when object_exists then null; +end; + + +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate + 'CREATE SEQUENCE CONEXION_RUTA_CONF_SEQ MINVALUE 1 MAXVALUE 9999999 INCREMENT BY 1 START WITH 101 CACHE 20 NOORDER NOCYCLE'; + exception when object_exists then null; +end; + +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CONEXION_RUTA_CTRL ADD (CONEXIONRUTACONF_ID NUMBER(7,0))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + except_02275 exception; + + pragma exception_init (column_exists , -01430); + pragma exception_init (column_exists , -02275); +begin + execute immediate 'ALTER TABLE CONEXION_RUTA_CTRL ADD CONSTRAINT FK_CONEXION_RUTA_CONF FOREIGN KEY (CONEXIONRUTACONF_ID) + REFERENCES CONEXION_RUTA_CONF(CONEXIONRUTACONF_ID)'; + exception when column_exists then null; +end; +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CONEXION_RUTA_CONF ADD (TIEMPOMIN NUMBER(7,0))'; + exception when column_exists then null; +end; +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CONEXION_RUTA_CONF ADD (TIEMPOMAX NUMBER(7,0))'; + exception when column_exists then null; +end; +/ + + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CONEXION_RUTA_CTRL ADD (CONEXIONRUTACONF_ID NUMBER(7,0))'; + exception when column_exists then null; +end; + +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CONEXION_RUTAEXCEPCIONTIPOPTA ADD (CONEXIONRUTACONF_ID NUMBER(7,0))'; + exception when column_exists then null; +end; +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CONEXION_RUTA_EXCEPCION_PTOVTA ADD (CONEXIONRUTACONF_ID NUMBER(7,0))'; + exception when column_exists then null; +end; +/ + +declare + column_exists exception; + except_02275 exception; + + pragma exception_init (column_exists , -01430); + pragma exception_init (column_exists , -02275); +begin + execute immediate 'ALTER TABLE CONEXION_RUTAEXCEPCIONTIPOPTA ADD CONSTRAINT FK_CONEXION_RUTACONF_TPPTA FOREIGN KEY (CONEXIONRUTACONF_ID) + REFERENCES CONEXION_RUTA_CONF(CONEXIONRUTACONF_ID)'; + exception when column_exists then null; +end; +/ + + +declare + column_exists exception; + except_02275 exception; + + pragma exception_init (column_exists , -01430); + pragma exception_init (column_exists , -02275); +begin + execute immediate 'ALTER TABLE CONEXION_RUTA_EXCEPCION_PTOVTA ADD CONSTRAINT FK_CONEXION_RUTACONF_PTOVTA FOREIGN KEY (CONEXIONRUTACONF_ID) + REFERENCES CONEXION_RUTA_CONF(CONEXIONRUTACONF_ID)'; + exception when column_exists then null; +end; +/ \ No newline at end of file