diff --git a/src/db/migration/V20170807_1145__mantis9339.sql b/src/db/migration/V20170807_1145__mantis9339.sql new file mode 100644 index 000000000..7c052a9a6 --- /dev/null +++ b/src/db/migration/V20170807_1145__mantis9339.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE RUTA_SECUENCIA ADD (KMORIGINAL NUMBER(7,2) DEFAULT 0 NOT NULL)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/V20170807_1439__mantis9339.sql b/src/db/migration/V20170807_1439__mantis9339.sql new file mode 100644 index 000000000..c94f76b92 --- /dev/null +++ b/src/db/migration/V20170807_1439__mantis9339.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00001); +begin + execute immediate 'update ruta_secuencia r set r.kmoriginal = COALESCE((select t.cantkmreal - coalesce(t.cantkmentradasaida,0) from tramo t where t.tramo_id = r.tramo_id), 0)'; + exception when object_exists then null; +end;