summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Install
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2009-12-31 13:48:21 +0100
committermkanat%bugzilla.org <>2009-12-31 13:48:21 +0100
commit1a4a843db26f6c3c208fa5dfdca7933b7cb76db2 (patch)
tree6a5766dc9b7c6cd5a06eb80eb8043714da6af5da /Bugzilla/Install
parent958e1a758168b4908bcdd237518ab85b93d7e1bb (diff)
downloadbugzilla-1a4a843db26f6c3c208fa5dfdca7933b7cb76db2.tar.gz
bugzilla-1a4a843db26f6c3c208fa5dfdca7933b7cb76db2.tar.xz
Bug 520318: Add remove_from_db to Bugzilla:Group and use it to delete groups in editgroups.cgi
Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=dkl, a=LpSolit
Diffstat (limited to 'Bugzilla/Install')
-rw-r--r--Bugzilla/Install/DB.pm14
1 files changed, 14 insertions, 0 deletions
diff --git a/Bugzilla/Install/DB.pm b/Bugzilla/Install/DB.pm
index adbcb285f..7a9fa72d8 100644
--- a/Bugzilla/Install/DB.pm
+++ b/Bugzilla/Install/DB.pm
@@ -594,6 +594,8 @@ sub update_table_definitions {
_add_allows_unconfirmed_to_product_table();
+ _convert_flagtypes_fks_to_set_null();
+
################################################################
# New --TABLE-- changes should go *** A B O V E *** this point #
################################################################
@@ -3340,6 +3342,18 @@ sub _add_allows_unconfirmed_to_product_table {
}
}
+sub _convert_flagtypes_fks_to_set_null {
+ my $dbh = Bugzilla->dbh;
+ foreach my $column (qw(request_group_id grant_group_id)) {
+ my $fk = $dbh->bz_fk_info('flagtypes', $column);
+ if ($fk and !defined $fk->{DELETE}) {
+ # checksetup will re-create the FK with the appropriate definition
+ # at the end of its table upgrades, so we just drop it here.
+ $dbh->bz_drop_fk('flagtypes', $column);
+ }
+ }
+}
+
1;
__END__