| | 47 | if (DB::IsError($db_cdr)) { |
|---|
| | 48 | out(_("ERROR connectng to CDR DB to migrate, not done!")); |
|---|
| | 49 | freepbx_log(FPBX_LOG_ERROR,"failed to open CDR DB to add recordingfile and did fields"); |
|---|
| | 50 | } else { |
|---|
| | 51 | $sql = "SELECT recordingfile FROM cdr"; |
|---|
| | 52 | $confs = $db_cdr->getRow($sql, DB_FETCHMODE_ASSOC); |
|---|
| | 53 | outn(_("checking if recordingfile file field needed in cdr..")); |
|---|
| | 54 | if (DB::IsError($confs)) { // no error... Already done |
|---|
| | 55 | $sql = "ALTER TABLE cdr ADD recordingfile VARCHAR ( 255 ) NOT NULL default ''"; |
|---|
| | 56 | $results = $db_cdr->query($sql); |
|---|
| | 57 | if(DB::IsError($results)) { |
|---|
| | 58 | out(_("failed")); |
|---|
| | 59 | freepbx_log(FPBX_LOG_ERROR,"failed to add recordingfile fieled to cdr table during migration"); |
|---|
| | 60 | } |
|---|
| | 61 | out(_("added")); |
|---|
| | 62 | } else { |
|---|
| | 63 | out(_("already there")); |
|---|
| | 64 | } |
|---|
| 48 | | $sql = "SELECT recordingfile FROM cdr"; |
|---|
| 49 | | $confs = $db_cdr->getRow($sql, DB_FETCHMODE_ASSOC); |
|---|
| 50 | | outn(_("checking if recordingfile file field needed in cdr..")); |
|---|
| 51 | | if (DB::IsError($confs)) { // no error... Already done |
|---|
| 52 | | $sql = "ALTER TABLE cdr ADD recordingfile VARCHAR ( 255 ) NOT NULL default ''"; |
|---|
| 53 | | $results = $db_cdr->query($sql); |
|---|
| 54 | | if(DB::IsError($results)) { |
|---|
| 55 | | out(_("failed")); |
|---|
| 56 | | freepbx_log(FPBX_LOG_ERROR,"failed to add recordingfile fieled to cdr table during migration"); |
|---|
| | 66 | $sql = "SELECT did FROM cdr"; |
|---|
| | 67 | $confs = $db_cdr->getRow($sql, DB_FETCHMODE_ASSOC); |
|---|
| | 68 | outn(_("checking if did file field needed in cdr..")); |
|---|
| | 69 | if (DB::IsError($confs)) { // no error... Already done |
|---|
| | 70 | $sql = "ALTER TABLE cdr ADD did VARCHAR ( 50 ) NOT NULL default ''"; |
|---|
| | 71 | $results = $db_cdr->query($sql); |
|---|
| | 72 | if(DB::IsError($results)) { |
|---|
| | 73 | out(_("failed")); |
|---|
| | 74 | freepbx_log(FPBX_LOG_ERROR,"failed to add did fieled to cdr table during migration"); |
|---|
| 58 | | out(_("added")); |
|---|
| 59 | | } else { |
|---|
| 60 | | out(_("already there")); |
|---|
| 61 | | } |
|---|
| 62 | | |
|---|
| 63 | | $sql = "SELECT did FROM cdr"; |
|---|
| 64 | | $confs = $db_cdr->getRow($sql, DB_FETCHMODE_ASSOC); |
|---|
| 65 | | outn(_("checking if did file field needed in cdr..")); |
|---|
| 66 | | if (DB::IsError($confs)) { // no error... Already done |
|---|
| 67 | | $sql = "ALTER TABLE cdr ADD did VARCHAR ( 50 ) NOT NULL default ''"; |
|---|
| 68 | | $results = $db_cdr->query($sql); |
|---|
| 69 | | if(DB::IsError($results)) { |
|---|
| 70 | | out(_("failed")); |
|---|
| 71 | | freepbx_log(FPBX_LOG_ERROR,"failed to add did fieled to cdr table during migration"); |
|---|
| | 76 | out(_("added")); |
|---|
| | 77 | } else { |
|---|
| | 78 | out(_("already there")); |
|---|