diff options
author | mark <mark> | 2010-09-29 18:41:36 +0000 |
---|---|---|
committer | mark <mark> | 2010-09-29 18:41:36 +0000 |
commit | 9f4276f9abb6161c8fae3436f8f7972140914dc3 (patch) | |
tree | 515bc62bff000b474870b0b3ed3d78ac951d92b1 | |
parent | 678b51d93455d0ef2d9334ef1562243d76bd4d12 (diff) |
restore missing signup dates during upgrade, RT#9972
-rw-r--r-- | FS/FS/cust_main.pm | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index 7a0c7d6c8..89d35eeb5 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -9803,9 +9803,13 @@ sub queued_bill { sub _upgrade_data { #class method my ($class, %opts) = @_; - my $sql = 'UPDATE h_cust_main SET paycvv = NULL WHERE paycvv IS NOT NULL'; - my $sth = dbh->prepare($sql) or die dbh->errstr; - $sth->execute or die $sth->errstr; + foreach my $sql ( + 'UPDATE h_cust_main SET paycvv = NULL WHERE paycvv IS NOT NULL', + 'UPDATE cust_main SET signupdate = (SELECT signupdate FROM h_cust_main WHERE h_cust_main.custnum = cust_main.custnum ORDER BY historynum ASC LIMIT 1) WHERE signupdate IS NULL', + ) { + my $sth = dbh->prepare($sql) or die dbh->errstr; + $sth->execute or die $sth->errstr; + } } |