X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=bin%2Ftest_scrub;h=ecb7229430a8f81172e45bb9703c0b1976b559cc;hp=88edc335bd2ed08921a2a2680efcd277e9a3f291;hb=7c11a4fc80ec0478838d26645e30fe3b2b751edd;hpb=b5c4237a34aef94976bc343c8d9e138664fc3984 diff --git a/bin/test_scrub b/bin/test_scrub old mode 100644 new mode 100755 index 88edc335b..ecb722943 --- a/bin/test_scrub +++ b/bin/test_scrub @@ -3,6 +3,7 @@ #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. +die "remove this line to run -- NEVER ON A LIVE DATABASE"; #-all exports (all records in part_export, part_export_option export_svc) #-all non-POST invoice destinations (cust_main_invoice) @@ -23,9 +24,9 @@ getopts('h'); adminsuidsetup shift; foreach my $table (qw( - part_export - part_export_option export_svc + part_export_option + part_export payment_gateway payment_gateway_option agent_payment_gateway @@ -42,10 +43,28 @@ my $dsth = dbh->prepare("DELETE FROM cust_main_invoice WHERE dest != 'POST'") or die dbh->errstr; $dsth->execute or die $dsth->errstr; +foreach my $table (qw( cust_main cust_payby + cust_pay_pending cust_pay cust_pay_void cust_pay_batch + cust_refund +)) { + my $ccsth = dbh->prepare(" + UPDATE $table SET payinfo = '4111111111111111' + WHERE payby = 'CARD' OR payby = 'DCRD' + ") or die dbh->errstr; + $ccsth->execute or die $ccsth->errstr; +} + +my $sth = dbh->prepare("UPDATE part_event SET disabled = 'Y'"); +$sth->execute or die $sth->errstr; + my $conf = new FS::Conf; foreach my $item (qw( business-onlinepayment business-onlinepayment-ach + dump-localdest + dump-scpdest + cust_bill-ftp_spool + smtpmachine )) { $conf->delete($item); }