summaryrefslogtreecommitdiff
path: root/bin/test_scrub
diff options
context:
space:
mode:
authorcvs2git <cvs2git>2010-12-27 00:04:45 +0000
committercvs2git <cvs2git>2010-12-27 00:04:45 +0000
commitc82d349f864e6bd9f96fd1156903bc1f7193a203 (patch)
treee117a87533656110b6acd56fc0ca64289892a9f5 /bin/test_scrub
parent74e058c8a010ef6feb539248a550d0bb169c1e94 (diff)
This commit was manufactured by cvs2svn to create tag 'TORRUS_1_0_9'.TORRUS_1_0_9
Diffstat (limited to 'bin/test_scrub')
-rw-r--r--bin/test_scrub60
1 files changed, 0 insertions, 60 deletions
diff --git a/bin/test_scrub b/bin/test_scrub
deleted file mode 100644
index 88edc335b..000000000
--- a/bin/test_scrub
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/usr/bin/perl -w
-
-#This drops anything from the database that could cause live things to happen.
-#You'd want to do this on a test copy of your live database but NEVER on the
-#live database itself.
-
-#-all exports (all records in part_export, part_export_option export_svc)
-#-all non-POST invoice destinations (cust_main_invoice)
-#-all payment gateways and agent payment gw overrides (payment_gateway,
-# payment_gateway_option, agent_payment_gateway)
-#-everything in the job queue (queue and queue_arg)
-#-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::Schema qw(dbdef);
-
-getopts('h');
-
-adminsuidsetup shift;
-
-foreach my $table (qw(
- part_export
- part_export_option
- export_svc
- payment_gateway
- payment_gateway_option
- agent_payment_gateway
- queue
- queue_arg
-)) {
-
- my $sth = dbh->prepare("DELETE FROM $table") or die dbh->errstr;
- $sth->execute or die $sth->errstr;
-
-}
-
-my $dsth = dbh->prepare("DELETE FROM cust_main_invoice WHERE dest != 'POST'")
- or die dbh->errstr;
-$dsth->execute or die $dsth->errstr;
-
-my $conf = new FS::Conf;
-foreach my $item (qw(
- business-onlinepayment
- business-onlinepayment-ach
-)) {
- $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;