| 30 | | // added again here for alpha testerd uprgrading |
|---|
| 31 | | $sql = "SELECT sortorder FROM freepbx_settings"; |
|---|
| 32 | | $confs = $db->getRow($sql, DB_FETCHMODE_ASSOC); |
|---|
| 33 | | if (DB::IsError($confs)) { // no error... Already done |
|---|
| 34 | | $sql = "ALTER TABLE freepbx_settings ADD sortorder INT ( 11 ) NOT NULL DEFAULT 0"; |
|---|
| 35 | | $results = $db->query($sql); |
|---|
| 36 | | if(DB::IsError($results)) { |
|---|
| 37 | | die($results->getMessage()); |
|---|
| 38 | | } |
|---|
| 39 | | out("Added field sortorder to freepbx_settings"); |
|---|
| 40 | | } |
|---|
| 41 | | |
|---|
| 42 | | // Need to migrate the CDR table adding the recordingfile field. We get the creds from cdr_mysql.conf |
|---|
| | 30 | // Need to migrate the CDR table adding the recordingfile and did field. We get the creds from cdr_mysql.conf |
|---|
| 73 | | freepbx_log(FPBX_LOG_ERROR,"failed to add recordingfile filed to cdr table during migration"); |
|---|
| | 56 | freepbx_log(FPBX_LOG_ERROR,"failed to add recordingfile fieled to cdr table during migration"); |
|---|
| | 57 | } |
|---|
| | 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"); |
|---|