summaryrefslogtreecommitdiffstats
path: root/Bugzilla/DB
diff options
context:
space:
mode:
authorXiaoou Wu <xiaoou.wu@oracle.com>2010-03-02 00:26:08 +0100
committerMax Kanat-Alexander <mkanat@bugzilla.org>2010-03-02 00:26:08 +0100
commit8d0710acaba90364e20af1cb9d23a8ad62f3bcd3 (patch)
tree8e652d80aeee5ee12c6e2564e6b51571bc6b601c /Bugzilla/DB
parentcab671b774f077dbb47bf8904fb11cca60204ab0 (diff)
downloadbugzilla-8d0710acaba90364e20af1cb9d23a8ad62f3bcd3.tar.gz
bugzilla-8d0710acaba90364e20af1cb9d23a8ad62f3bcd3.tar.xz
Bug 541553: [Oracle] Drop triggers when dropping columns, and drop the
left-behind PRODUCTS_MILESTONEURL trigger that currently exists in 3.6/trunk. r=mkanat, a=mkanat
Diffstat (limited to 'Bugzilla/DB')
-rw-r--r--Bugzilla/DB/Oracle.pm8
-rw-r--r--Bugzilla/DB/Schema/Oracle.pm16
2 files changed, 24 insertions, 0 deletions
diff --git a/Bugzilla/DB/Oracle.pm b/Bugzilla/DB/Oracle.pm
index 801823372..5dd127882 100644
--- a/Bugzilla/DB/Oracle.pm
+++ b/Bugzilla/DB/Oracle.pm
@@ -676,6 +676,14 @@ sub bz_setup_database {
}
}
+ # Drop the trigger which causes bug 541553
+ my $trigger_name = "PRODUCTS_MILESTONEURL";
+ my $exist_trigger = $self->selectcol_arrayref(
+ "SELECT OBJECT_NAME FROM USER_OBJECTS
+ WHERE OBJECT_NAME = ?", undef, $trigger_name);
+ if(@$exist_trigger) {
+ $self->do("DROP TRIGGER $trigger_name");
+ }
}
package Bugzilla::DB::Oracle::st;
diff --git a/Bugzilla/DB/Schema/Oracle.pm b/Bugzilla/DB/Schema/Oracle.pm
index 814a842b3..e8905eb80 100644
--- a/Bugzilla/DB/Schema/Oracle.pm
+++ b/Bugzilla/DB/Schema/Oracle.pm
@@ -412,4 +412,20 @@ sub get_set_serial_sql {
return @sql;
}
+sub get_drop_column_ddl {
+ my $self = shift;
+ my ($table, $column) = @_;
+ my @sql;
+ push(@sql, $self->SUPER::get_drop_column_ddl(@_));
+ my $dbh=Bugzilla->dbh;
+ my $trigger_name = uc($table . "_" . $column);
+ my $exist_trigger = $dbh->selectcol_arrayref(
+ "SELECT OBJECT_NAME FROM USER_OBJECTS
+ WHERE OBJECT_NAME = ?", undef, $trigger_name);
+ if(@$exist_trigger) {
+ push(@sql, "DROP TRIGGER $trigger_name");
+ }
+ return @sql;
+}
+
1;