Merge pull request 'GLPI 60358 - Erro ao alterar código ANTT de localidade' (#19) from AL-2145 into master

Reviewed-on: http://18.235.188.113:3000/utilidades/Flyway/pulls/19
Reviewed-by: Célio de Souza Ribeiro JR <celio@rjconsultores.com.br>
Reviewed-by: Lucas Taiã <lucas@rjconsultores.com.br>
master
fabio 2023-02-13 20:59:09 +00:00
commit 924d1f6215
3 changed files with 39 additions and 1 deletions

View File

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>br.com.rjconsultores</groupId>
<artifactId>Flyway</artifactId>
<version>1.0.21</version>
<version>1.0.22</version>
<distributionManagement>
<repository>

View File

@ -0,0 +1,19 @@
declare
indice_nao_existe exception;
pragma exception_init (indice_nao_existe , -01418);
begin
execute immediate 'DROP INDEX UNIQUE_CODANTT';
exception when indice_nao_existe then null;
end;
/
DECLARE
object_exists exception;
except_01408 exception;
pragma exception_init (object_exists , -00955);
pragma exception_init (except_01408 , -01408);
BEGIN
execute IMMEDIATE 'CREATE UNIQUE INDEX UNIQUE_CODANTT ON PARADA (CASE WHEN ACTIVO = 1 THEN CODANTT ELSE NULL END)';
exception
when object_exists THEN null;
when except_01408 THEN null;
END;

View File

@ -0,0 +1,19 @@
declare
indice_nao_existe exception;
pragma exception_init (indice_nao_existe , -01418);
begin
execute immediate 'DROP INDEX UNIQUE_CODANTT';
exception when indice_nao_existe then null;
end;
/
DECLARE
object_exists exception;
except_01408 exception;
pragma exception_init (object_exists , -00955);
pragma exception_init (except_01408 , -01408);
BEGIN
execute IMMEDIATE 'CREATE UNIQUE INDEX UNIQUE_CODANTT ON PARADA (CASE WHEN ACTIVO = 1 THEN CODANTT ELSE NULL END)';
exception
when object_exists THEN null;
when except_01408 THEN null;
END;