summaryrefslogtreecommitdiff
path: root/FS/bin
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2015-12-10 11:10:09 -0800
committerIvan Kohler <ivan@freeside.biz>2015-12-10 11:10:09 -0800
commit5259890066c6a6dc90048b209cfb86550d5336a4 (patch)
tree8725555793a573e452ce071eb063861f418db4c7 /FS/bin
parent083055aebf83987941affc4da3184dec0f27d2ae (diff)
don't auto-add the column under non-mysql, RT#39250
Diffstat (limited to 'FS/bin')
-rwxr-xr-xFS/bin/freeside-cdr-asterisk_sql20
1 files changed, 11 insertions, 9 deletions
diff --git a/FS/bin/freeside-cdr-asterisk_sql b/FS/bin/freeside-cdr-asterisk_sql
index 160780bde..5c90ab48b 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(