summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Install
diff options
context:
space:
mode:
authormiketosh <michael.j.tosh@lmco.com>2011-10-23 14:18:04 +0200
committerFrédéric Buclin <LpSolit@gmail.com>2011-10-23 14:18:04 +0200
commit5173b6cbadea03c8525218f09794b3f74ab12d96 (patch)
tree05aaf3f5230a04647ca371480dae85f974d035de /Bugzilla/Install
parentce3970fd0a2890b88485c2723e7af1633544c741 (diff)
downloadbugzilla-5173b6cbadea03c8525218f09794b3f74ab12d96.tar.gz
bugzilla-5173b6cbadea03c8525218f09794b3f74ab12d96.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__