projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
de27e71
)
remove cards too, try to be extra-safe
author
Ivan Kohler
<ivan@freeside.biz>
Wed, 13 Nov 2013 19:08:04 +0000
(11:08 -0800)
committer
Ivan Kohler
<ivan@freeside.biz>
Wed, 13 Nov 2013 19:08:04 +0000
(11:08 -0800)
bin/test_scrub
patch
|
blob
|
history
diff --git
a/bin/test_scrub
b/bin/test_scrub
index
45a257a
..
e39a28a
100644
(file)
--- 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.
#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)
#-all exports (all records in part_export, part_export_option export_svc)
#-all non-POST invoice destinations (cust_main_invoice)
@@
-42,6
+43,17
@@
my $dsth = dbh->prepare("DELETE FROM cust_main_invoice WHERE dest != 'POST'")
or die dbh->errstr;
$dsth->execute or die $dsth->errstr;
or die dbh->errstr;
$dsth->execute or die $dsth->errstr;
+foreach my $table (qw( cust_main
+ 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 $sth = dbh->prepare("UPDATE part_event SET disabled = 'Y'");
$sth->execute or die $sth->errstr;