diff options
author | ivan <ivan> | 2009-04-17 23:30:57 +0000 |
---|---|---|
committer | ivan <ivan> | 2009-04-17 23:30:57 +0000 |
commit | 246c311ac0ca7c41c571cfbc434bafd7c5d2768c (patch) | |
tree | 3305914518c2c354d86e58eb351726a638079420 | |
parent | 4ee28b411fa819a420926b8a6e60be043fdb1d2e (diff) |
something to wipe the CVV from very large databases
-rwxr-xr-x | bin/fs-migrate-cust_tax_exempt | 2 | ||||
-rwxr-xr-x | bin/h_cust_main-wipe_paycvv | 30 |
2 files changed, 31 insertions, 1 deletions
diff --git a/bin/fs-migrate-cust_tax_exempt b/bin/fs-migrate-cust_tax_exempt index ede80b08e..35c74ffab 100755 --- a/bin/fs-migrate-cust_tax_exempt +++ b/bin/fs-migrate-cust_tax_exempt @@ -23,7 +23,7 @@ my $fuz = 7; #seconds #site-specific rewrites my %rewrite = ( #cust_tax_exempt.exemptnum => { 'field' => 'newvalue', ... }, - '23' => { month=>10, year=>2005, invnum=>1640 }, +# '23' => { month=>10, year=>2005, invnum=>1640 }, #etc. ); diff --git a/bin/h_cust_main-wipe_paycvv b/bin/h_cust_main-wipe_paycvv new file mode 100755 index 000000000..d34c15f34 --- /dev/null +++ b/bin/h_cust_main-wipe_paycvv @@ -0,0 +1,30 @@ +#!/usr/bin/perl + +use strict; +use FS::UID qw(adminsuidsetup dbh); +use FS::Record; #buh? + +my $user = shift or die 'usage'; +adminsuidsetup $user; + +while (1) { + + my $sql = ' UPDATE h_cust_main SET paycvv = NULL + WHERE historynum IN ( SELECT historynum FROM h_cust_main + WHERE paycvv IS NOT NULL LIMIT 8192 )'; +# WHERE paycvv IS NOT NULL LIMIT 1 )'; + + my $sth = dbh->prepare($sql) or die dbh->errstr; + + print '.'; $|=1; + + my $rv = $sth->execute; + + dbh->commit or die dbh->errstr; + + last if $rv == 0; + +} + +print "\n"; + |