summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2008-10-22 06:28:47 +0200
committerlpsolit%gmail.com <>2008-10-22 06:28:47 +0200
commit55e5f706991e787a1e8682f3daa31ed47ea11be6 (patch)
tree334022512782e502e816e03a6a42027dc26fb66e /Bugzilla
parent96c07aa8e5b598b60cee425bf3385773796a94f2 (diff)
downloadbugzilla-55e5f706991e787a1e8682f3daa31ed47ea11be6.tar.gz
bugzilla-55e5f706991e787a1e8682f3daa31ed47ea11be6.tar.xz
Bug 460922: [Oracle] Need to drop all the FKs before dropping tables - Patch by Xiaoou <xiaoou.wu@oracle.com> r/a=mkanat
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/DB/Oracle.pm18
1 files changed, 18 insertions, 0 deletions
diff --git a/Bugzilla/DB/Oracle.pm b/Bugzilla/DB/Oracle.pm
index 9399bf225..c8195d4a7 100644
--- a/Bugzilla/DB/Oracle.pm
+++ b/Bugzilla/DB/Oracle.pm
@@ -208,6 +208,24 @@ sub sql_in {
return "( " . join(" OR ", @in_str) . " )";
}
+sub bz_drop_table {
+ my ($self, $name) = @_;
+ my $table_exists = $self->bz_table_info($name);
+ if ($table_exists) {
+ $self->_bz_drop_fks($name);
+ $self->SUPER::bz_drop_table($name);
+ }
+}
+
+# Dropping all FKs for a specified table.
+sub _bz_drop_fks {
+ my ($self, $table) = @_;
+ my @columns = $self->_bz_real_schema->get_table_columns($table);
+ foreach my $column (@columns) {
+ $self->bz_drop_fk($table, $column);
+ }
+}
+
sub _fix_empty {
my ($string) = @_;
$string = '' if $string eq EMPTY_STRING;