Skip to content

Commit

Permalink
Remove constraint name from global_names when dropping.
Browse files Browse the repository at this point in the history
  • Loading branch information
bvallerand committed Feb 23, 2024
1 parent 682f21a commit fce5425
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/SQL/Translator/Producer/Oracle.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit fce5425

Please sign in to comment.