From 33cdb9a6a8fe2d7c9ed7951003d88d63be4492ef Mon Sep 17 00:00:00 2001 From: frederico Date: Mon, 1 Aug 2016 20:29:40 +0000 Subject: [PATCH] =?UTF-8?q?fixed=20bug=20#7782=20Copiar/mudar=20vig=C3=AAn?= =?UTF-8?q?cia=20-=20habilitada=20op=C3=A7=C3=A3o=20todas=20empresas;=20co?= =?UTF-8?q?rrigido=20problema=20de=20duplicidade=20de=20tarifas.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@58624 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../tarifas/CambioVigenciaController.java | 2 +- .../V20160801_1732__dropTarifaUnica.sql | 28 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 src/java/db/migration/V20160801_1732__dropTarifaUnica.sql diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/CambioVigenciaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/CambioVigenciaController.java index 211a64191..77b5150d4 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/CambioVigenciaController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/CambioVigenciaController.java @@ -96,7 +96,7 @@ public class CambioVigenciaController extends MyGenericForwardComposer { @Override public void doAfterCompose(Component comp) throws Exception { lsVigenciaTarifa = vigenciaTarifaService.obtenerTodos(); - lsEmpresa = empresaService.obtenerTodos(); + lsEmpresa = empresaService.obtenerTodosIncluindoEmpresaTodas(); super.doAfterCompose(comp); } diff --git a/src/java/db/migration/V20160801_1732__dropTarifaUnica.sql b/src/java/db/migration/V20160801_1732__dropTarifaUnica.sql new file mode 100644 index 000000000..a1f0b2f3c --- /dev/null +++ b/src/java/db/migration/V20160801_1732__dropTarifaUnica.sql @@ -0,0 +1,28 @@ +--drop constraint se existe +DECLARE +itemExists NUMBER; +BEGIN + itemExists := 0; + +SELECT COUNT(CONSTRAINT_NAME) INTO itemExists +FROM ALL_CONSTRAINTS +WHERE UPPER(CONSTRAINT_NAME) = UPPER('TARIFA_UNICA'); + +IF itemExists > 0 THEN +EXECUTE IMMEDIATE 'ALTER TABLE TARIFA DROP CONSTRAINT TARIFA_UNICA'; +END IF; + +END; + +-- drop index se existe +DECLARE + COUNT_INDEXES INTEGER; +BEGIN + SELECT COUNT(*) INTO COUNT_INDEXES + FROM USER_INDEXES + WHERE INDEX_NAME = '"VTABOL"."TARIFA_UNICA"'; + + IF COUNT_INDEXES > 0 THEN + EXECUTE IMMEDIATE 'DROP INDEX "VTABOL"."TARIFA_UNICA"'; + END IF; +END; \ No newline at end of file