From 14c74709049a89d2e737d8d8deed662f8dc00f30 Mon Sep 17 00:00:00 2001 From: emerson Date: Tue, 2 Jul 2019 14:34:33 +0000 Subject: [PATCH] =?UTF-8?q?fixes=20bug#0014336=20dev:=20thiago=20qua:=20Im?= =?UTF-8?q?plementa=C3=A7=C3=A3o=20efetuada.?= 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/BD/FlyWay/trunk@95295 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../migration/V20190627_1756__mantis14336.sql | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/db/migration/V20190627_1756__mantis14336.sql diff --git a/src/db/migration/V20190627_1756__mantis14336.sql b/src/db/migration/V20190627_1756__mantis14336.sql new file mode 100644 index 000000000..c5571b4ee --- /dev/null +++ b/src/db/migration/V20190627_1756__mantis14336.sql @@ -0,0 +1,23 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate + 'ALTER TABLE ESTACION ADD DT_MAX_PRINT_LOG_SERVIDOR DATE'; + exception when object_exists then null; +end; +/ +declare +begin + execute immediate + 'CREATE OR REPLACE TRIGGER TRG_CHECK_ESTACION_PRINT_LOG + BEFORE INSERT OR UPDATE ON VTABOL.ESTACION + FOR EACH ROW + BEGIN + IF( :NEW.DT_MAX_PRINT_LOG_SERVIDOR > SYSDATE + 5 ) + THEN + RAISE_APPLICATION_ERROR( -20001, + ''DATA INVÁLIDA: CAMPO ESTACION.PRINT_LOG_SERVIDOR NÃO PODERÁ ULTRAPASSAR O LIMITE MÁXIMO DE 5 DIAS DA DATA ATUAL''); + END IF; + END;'; +end; \ No newline at end of file