diff options
Diffstat (limited to 'Bugzilla/Install/DB.pm')
-rw-r--r-- | Bugzilla/Install/DB.pm | 14 |
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__ |