diff options
author | Xiaoou Wu <xiaoou.wu@oracle.com> | 2010-03-01 15:26:08 -0800 |
---|---|---|
committer | Max Kanat-Alexander <mkanat@bugzilla.org> | 2010-03-01 15:26:08 -0800 |
commit | 8d0710acaba90364e20af1cb9d23a8ad62f3bcd3 (patch) | |
tree | 8e652d80aeee5ee12c6e2564e6b51571bc6b601c /Bugzilla | |
parent | cab671b774f077dbb47bf8904fb11cca60204ab0 (diff) | |
download | bugs-8d0710acaba90364e20af1cb9d23a8ad62f3bcd3.tar bugs-8d0710acaba90364e20af1cb9d23a8ad62f3bcd3.tar.gz bugs-8d0710acaba90364e20af1cb9d23a8ad62f3bcd3.tar.bz2 bugs-8d0710acaba90364e20af1cb9d23a8ad62f3bcd3.tar.xz bugs-8d0710acaba90364e20af1cb9d23a8ad62f3bcd3.zip |
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')
-rw-r--r-- | Bugzilla/DB/Oracle.pm | 8 | ||||
-rw-r--r-- | Bugzilla/DB/Schema/Oracle.pm | 16 |
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; |