diff options
-rwxr-xr-x | contrib/sanitizeme.pl | 10 | ||||
-rw-r--r-- | extensions/BugmailFilter/Extension.pm | 6 | ||||
-rw-r--r-- | extensions/EditComments/Extension.pm | 7 | ||||
-rw-r--r-- | extensions/Push/Extension.pm | 10 |
4 files changed, 26 insertions, 7 deletions
diff --git a/contrib/sanitizeme.pl b/contrib/sanitizeme.pl index c80069912..2e7613a6e 100755 --- a/contrib/sanitizeme.pl +++ b/contrib/sanitizeme.pl @@ -29,6 +29,7 @@ use lib qw(.); use Bugzilla; use Bugzilla::Bug; use Bugzilla::Constants; +use Bugzilla::Hook; use Bugzilla::Util; use List::MoreUtils qw(uniq); @@ -87,6 +88,7 @@ eval { delete_sensitive_user_data(); delete_attachment_data() unless $keep_attachments; delete_bug_user_last_visit(); + Bugzilla::Hook::process('db_sanitize'); disable_email_delivery() unless $enable_email; print "All done!\n"; $dbh->bz_rollback_transaction() if $dry_run; @@ -188,12 +190,6 @@ sub delete_sensitive_user_data { $dbh->do("DELETE FROM ts_funcmap"); $dbh->do("DELETE FROM ts_job"); $dbh->do("DELETE FROM ts_note"); - # push extension messages - $dbh->do("DELETE FROM push"); - $dbh->do("DELETE FROM push_backlog"); - $dbh->do("DELETE FROM push_backoff"); - $dbh->do("DELETE FROM push_log"); - $dbh->do("DELETE FROM push_options"); } sub delete_attachment_data { @@ -203,7 +199,7 @@ sub delete_attachment_data { } sub delete_bug_user_last_visit { - print "Removing all entries from bug_user_last_visit...\n" + print "Removing all entries from bug_user_last_visit...\n"; $dbh->do('TRUNCATE TABLE bug_user_last_visit'); } diff --git a/extensions/BugmailFilter/Extension.pm b/extensions/BugmailFilter/Extension.pm index 01719db1f..053b07575 100644 --- a/extensions/BugmailFilter/Extension.pm +++ b/extensions/BugmailFilter/Extension.pm @@ -427,4 +427,10 @@ sub db_schema_abstract_schema { }; } +sub db_sanitize { + my $dbh = Bugzilla->dbh; + print "Deleting bugmail filters...\n"; + $dbh->do("DELETE FROM bugmail_filters"); +} + __PACKAGE__->NAME; diff --git a/extensions/EditComments/Extension.pm b/extensions/EditComments/Extension.pm index a3769544f..fef1b7693 100644 --- a/extensions/EditComments/Extension.pm +++ b/extensions/EditComments/Extension.pm @@ -260,4 +260,11 @@ sub webservice { $dispatch->{EditComments} = "Bugzilla::Extension::EditComments::WebService"; } +sub db_sanitize { + my $dbh = Bugzilla->dbh; + print "Deleting edited comment histories...\n"; + $dbh->do("DELETE FROM longdescs_activity"); + $dbh->do("UPDATE longdescs SET edit_count=0"); +} + __PACKAGE__->NAME; diff --git a/extensions/Push/Extension.pm b/extensions/Push/Extension.pm index 3332df8e8..1d6ec5b62 100644 --- a/extensions/Push/Extension.pm +++ b/extensions/Push/Extension.pm @@ -645,4 +645,14 @@ sub install_filesystem { }; } +sub db_sanitize { + my $dbh = Bugzilla->dbh; + print "Deleting push extension logs and messages...\n"; + $dbh->do("DELETE FROM push"); + $dbh->do("DELETE FROM push_backlog"); + $dbh->do("DELETE FROM push_backoff"); + $dbh->do("DELETE FROM push_log"); + $dbh->do("DELETE FROM push_options"); +} + __PACKAGE__->NAME; |