[freeside-commits] branch FREESIDE_3_BRANCH updated. e87cdcc9db92402c005b96daacef99bb28af5cc4

Ivan ivan at 420.am
Thu Dec 10 11:10:18 PST 2015


The branch, FREESIDE_3_BRANCH has been updated
       via  e87cdcc9db92402c005b96daacef99bb28af5cc4 (commit)
      from  a32c137aecd37144e276c3339f66a15318c80698 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit e87cdcc9db92402c005b96daacef99bb28af5cc4
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Thu Dec 10 11:10:16 2015 -0800

    don't auto-add the column under non-mysql, RT#39250

diff --git a/FS/bin/freeside-cdr-asterisk_sql b/FS/bin/freeside-cdr-asterisk_sql
index 160780b..5c90ab4 100755
--- a/FS/bin/freeside-cdr-asterisk_sql
+++ b/FS/bin/freeside-cdr-asterisk_sql
@@ -26,16 +26,18 @@ adminsuidsetup $user;
 
 my $fsdbh = FS::UID::dbh;
 
-# check for existence of freesidestatus
 my $table = $opt{T} || 'cdr';
-my $status = $dbi->selectall_arrayref("SHOW COLUMNS FROM $table WHERE Field = 'freesidestatus'");
-if( ! @$status ) {
-  print "Adding freesidestatus column...\n";
-  $dbi->do("ALTER TABLE $table ADD COLUMN freesidestatus varchar(32)")
-    or die $dbi->errstr;
-}
-else {
-  print "freesidestatus column present\n";
+
+# check for existence of freesidestatus
+if ( $engine =~ /^mysql/ ) {
+  my $status = $dbi->selectall_arrayref("SHOW COLUMNS FROM $table WHERE Field = 'freesidestatus'");
+  if( ! @$status ) {
+    print "Adding freesidestatus column...\n";
+    $dbi->do("ALTER TABLE $table ADD COLUMN freesidestatus varchar(32)")
+      or die $dbi->errstr;
+  } else {
+    print "freesidestatus column present\n";
+  }
 }
 
 my @cols = ( qw( 

-----------------------------------------------------------------------

Summary of changes:
 FS/bin/freeside-cdr-asterisk_sql |   20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)




More information about the freeside-commits mailing list