diff options
author | Ivan Kohler <ivan@freeside.biz> | 2015-12-10 11:10:09 -0800 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2015-12-10 11:10:09 -0800 |
commit | 5259890066c6a6dc90048b209cfb86550d5336a4 (patch) | |
tree | 8725555793a573e452ce071eb063861f418db4c7 /FS/bin | |
parent | 083055aebf83987941affc4da3184dec0f27d2ae (diff) |
don't auto-add the column under non-mysql, RT#39250
Diffstat (limited to 'FS/bin')
-rwxr-xr-x | FS/bin/freeside-cdr-asterisk_sql | 20 |
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( |