projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
85fbf4f
)
mysql compat fix, try again, #28895
author
Mark Wells
<mark@freeside.biz>
Thu, 17 Jul 2014 19:58:59 +0000
(12:58 -0700)
committer
Mark Wells
<mark@freeside.biz>
Thu, 17 Jul 2014 19:58:59 +0000
(12:58 -0700)
FS/FS/cust_pay.pm
patch
|
blob
|
history
diff --git
a/FS/FS/cust_pay.pm
b/FS/FS/cust_pay.pm
index
153390b
..
54b8e90
100644
(file)
--- a/
FS/FS/cust_pay.pm
+++ b/
FS/FS/cust_pay.pm
@@
-11,6
+11,7
@@
use Business::CreditCard;
use Text::Template;
use FS::Misc::DateTime qw( parse_datetime ); #for batch_import
use FS::Record qw( dbh qsearch qsearchs );
use Text::Template;
use FS::Misc::DateTime qw( parse_datetime ); #for batch_import
use FS::Record qw( dbh qsearch qsearchs );
+use FS::UID qw( driver_name );
use FS::CurrentUser;
use FS::payby;
use FS::cust_main_Mixin;
use FS::CurrentUser;
use FS::payby;
use FS::cust_main_Mixin;
@@
-1050,9
+1051,10
@@
sub process_upgrade_paybatch {
###
# migrate batchnums from the misused 'paybatch' field to 'batchnum'
###
###
# 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',
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);
} );
while (my $cust_pay = $search->fetch) {
$cust_pay->set('batchnum' => $cust_pay->paybatch);