projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix mixin inheritence preventing prorate_delayed packages from billing, RT#14372
[freeside.git]
/
bin
/
test_scrub
diff --git
a/bin/test_scrub
b/bin/test_scrub
index
5766925
..
88edc33
100644
(file)
--- a/
bin/test_scrub
+++ b/
bin/test_scrub
@@
-12,8
+12,13
@@
#-business-onlinepayment and business-onlinepayment-ach config
use strict;
#-business-onlinepayment and business-onlinepayment-ach config
use strict;
+use vars qw( $opt_h );
+use Getopt::Std;
use FS::UID qw(adminsuidsetup dbh);
use FS::Conf;
use FS::UID qw(adminsuidsetup dbh);
use FS::Conf;
+use FS::Schema qw(dbdef);
+
+getopts('h');
adminsuidsetup shift;
adminsuidsetup shift;
@@
-45,4
+50,11
@@
foreach my $item (qw(
$conf->delete($item);
}
$conf->delete($item);
}
+if ($opt_h) { # not all history can be safely deleted
+ foreach my $table (grep { /^h_\w+$/ } dbdef->tables) {
+ my $sth = dbh->prepare("DELETE FROM $table") or die dbh->errstr;
+ $sth->execute or die $sth->errstr;
+ }
+}
+
dbh->commit or die dbh->errstr;
dbh->commit or die dbh->errstr;