diff options
author | Mark Wells <mark@freeside.biz> | 2014-07-17 12:40:17 -0700 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2014-07-17 12:50:16 -0700 |
commit | 7e9c8df93590ae1319539626c540c97b9199beb0 (patch) | |
tree | b914b2c62ffadc2b8c61067a22ea2930b9856fb9 | |
parent | 6e004ea979eeb1059173781d2870bf410fa1e1ac (diff) |
mysql compat fix, try again, #28895
-rw-r--r-- | FS/FS/cust_pay.pm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/FS/FS/cust_pay.pm b/FS/FS/cust_pay.pm index aa5655d99..139837c3a 100644 --- a/FS/FS/cust_pay.pm +++ b/FS/FS/cust_pay.pm @@ -9,7 +9,7 @@ use vars qw( $DEBUG $me $conf @encrypted_fields use Date::Format; use Business::CreditCard; use Text::Template; -use FS::UID qw( getotaker ); +use FS::UID qw( getotaker driver_name ); use FS::Misc qw( send_email ); use FS::Misc::DateTime qw( parse_datetime ); #for batch_import use FS::Record qw( dbh qsearch qsearchs ); @@ -1077,9 +1077,10 @@ sub process_upgrade_paybatch { ### # migrate batchnums from the misused 'paybatch' field to 'batchnum' ### + my $text = (driver_name =~ /^mysql/i) ? 'char' : 'text'; my $search = FS::Cursor->new( { 'table' => 'cust_pay', - 'addl_from' => ' JOIN pay_batch ON cust_pay.paybatch = CONCAT(pay_batch.batchnum) ', + 'addl_from' => " JOIN pay_batch ON cust_pay.paybatch = CAST(pay_batch.batchnum AS $text) ", } ); while (my $cust_pay = $search->fetch) { $cust_pay->set('batchnum' => $cust_pay->paybatch); |