From 692151de9dc6cf509c88d6b83890d1265d7a7509 Mon Sep 17 00:00:00 2001 From: Ben Vallerand Date: Fri, 23 Feb 2024 14:29:49 -0500 Subject: [PATCH] Remove constraint from global_names if dropping. --- lib/SQL/Translator/Producer/Oracle.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/SQL/Translator/Producer/Oracle.pm b/lib/SQL/Translator/Producer/Oracle.pm index 3fbf6008..eddf9350 100644 --- a/lib/SQL/Translator/Producer/Oracle.pm +++ b/lib/SQL/Translator/Producer/Oracle.pm @@ -678,9 +678,14 @@ sub alter_drop_constraint { my @out = ('ALTER', 'TABLE', $table_name, 'DROP',); if ($c->name) { push @out, ('CONSTRAINT', quote($c->name, $qi)); + if ($global_names{$c->name}) { + $global_names{$c->name}--; # Remove from global names so it can be used again + } } elsif ($c->type eq PRIMARY_KEY) { push @out, 'PRIMARY KEY'; } + debug("ORA: Dropping constraint " . join(' ', @out)); + return join(' ', @out); }