Skip to content

Commit

Permalink
Remove constraint from global_names if dropping.
Browse files Browse the repository at this point in the history
  • Loading branch information
hazardv committed Feb 23, 2024
1 parent 682f21a commit 692151d
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 692151d

Please sign in to comment.