From 97a0d45b8c3faae0c0f062e51c14bb7931f8d6f3 Mon Sep 17 00:00:00 2001 From: leonardo Date: Mon, 7 Aug 2017 20:42:32 +0000 Subject: [PATCH] fixes bug #9339 git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/BD/FlyWay/trunk@72392 d1611594-4594-4d17-8e1d-87c2c4800839 --- src/db/migration/V20170807_1145__mantis9339.sql | 7 +++++++ src/db/migration/V20170807_1439__mantis9339.sql | 7 +++++++ 2 files changed, 14 insertions(+) create mode 100644 src/db/migration/V20170807_1145__mantis9339.sql create mode 100644 src/db/migration/V20170807_1439__mantis9339.sql 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;