Commit 8d0710ac authored by Xiaoou Wu's avatar Xiaoou Wu Committed by Max Kanat-Alexander

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
parent cab671b7
......@@ -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;
......
......@@ -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;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment