summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Install
diff options
context:
space:
mode:
authormiketosh <michael.j.tosh@lmco.com>2011-10-23 14:20:15 +0200
committerFrédéric Buclin <LpSolit@gmail.com>2011-10-23 14:20:15 +0200
commitd47f6057e0257b3282ff25a144b9ef36ec741012 (patch)
treef390798c18074a9eda97f5801abdf81712cafb9a /Bugzilla/Install
parent0122a4e056b7f9c4f22d7c67ba9801f0c8c49d71 (diff)
downloadbugzilla-d47f6057e0257b3282ff25a144b9ef36ec741012.tar.gz
bugzilla-d47f6057e0257b3282ff25a144b9ef36ec741012.tar.xz
Bug 690173: Cannot delete user accounts due to FK on audit_log
r/a=mkanat
Diffstat (limited to 'Bugzilla/Install')
-rw-r--r--Bugzilla/Install/DB.pm12
1 files changed, 12 insertions, 0 deletions
diff --git a/Bugzilla/Install/DB.pm b/Bugzilla/Install/DB.pm
index 5ce3c7a4e..84267de41 100644
--- a/Bugzilla/Install/DB.pm
+++ b/Bugzilla/Install/DB.pm
@@ -656,6 +656,9 @@ sub update_table_definitions {
# 2011-06-15 dkl@mozilla.com - Bug 658929
_migrate_disabledtext_boolean();
+ # 2011-10-11 miketosh - Bug 690173
+ _on_delete_set_null_for_audit_log_userid();
+
################################################################
# New --TABLE-- changes should go *** A B O V E *** this point #
################################################################
@@ -3602,6 +3605,15 @@ sub _rename_tags_to_tag {
}
}
+sub _on_delete_set_null_for_audit_log_userid {
+ my $dbh = Bugzilla->dbh;
+ my $fk = $dbh->bz_fk_info('audit_log', 'user_id');
+ if ($fk and !defined $fk->{DELETE}) {
+ $fk->{DELETE} = 'SET NULL';
+ $dbh->bz_alter_fk('audit_log', 'user_id', $fk);
+ }
+}
+
1;
__END__