From 9dc3ca0443da5ef9ec6cb2915ccf739cce60b8e4 Mon Sep 17 00:00:00 2001 From: gleimar Date: Tue, 19 Sep 2017 01:16:23 +0000 Subject: [PATCH] fixes bug#9842 git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/BD/FlyWay/trunk@73958 d1611594-4594-4d17-8e1d-87c2c4800839 --- src/db/migration/V20170918_2217__mantis9842.sql | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/db/migration/V20170918_2217__mantis9842.sql diff --git a/src/db/migration/V20170918_2217__mantis9842.sql b/src/db/migration/V20170918_2217__mantis9842.sql new file mode 100644 index 000000000..53b495dae --- /dev/null +++ b/src/db/migration/V20170918_2217__mantis9842.sql @@ -0,0 +1,9 @@ +update + esquema_corrida ec + + set ec.ROLOPERATIVO_ID = (select ec2.ROLOPERATIVO2_ID from esquema_corrida ec2 where ec2.activo =1 and ec2.NUMCORRIDAPISOEXTRA= ec.numcorrida and ec2.indpisoextra =1) +where + (ec.NUMCORRIDAPISOEXTRA is null) + and exists (select * from esquema_corrida ec3 where ec3.activo = 1 and ec3.NUMCORRIDAPISOEXTRA = ec.numcorrida) + and ec.ROLOPERATIVO_ID <> (select ec4.ROLOPERATIVO2_ID from esquema_corrida ec4 where ec4.activo =1 and ec4.NUMCORRIDAPISOEXTRA = ec.numcorrida ) + and activo = 1; \ No newline at end of file