From 546de5add16d0dda22a7e958019add673f169db1 Mon Sep 17 00:00:00 2001 From: stevenA Date: Sun, 16 Jan 2022 16:04:41 +0100 Subject: [PATCH] Modify installer db calls to remove IF EXISTS IF EXISTS is not correct in MariaDb v5, used in all FreePbx Packages. --- install.php | 4 ++-- module.xml | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/install.php b/install.php index 5a76416..f7f9707 100644 --- a/install.php +++ b/install.php @@ -433,7 +433,7 @@ function InstallDB_updateSchema($db_config) } // Processed all _Column names; now safe to delete them $sqlDrop = array_reduce($fieldsArr, function($carry, $column) { - return "${carry} DROP COLUMN IF EXISTS ${column},"; + return "${carry} DROP COLUMN ${column},"; }); $sqlDrop = rtrim($sqlDrop, ", "); $stmt = $db->prepare("ALTER TABLE ${table} ${sqlDrop}"); @@ -463,7 +463,7 @@ function InstallDB_updateSchema($db_config) // occur as columns that are dropped should no longer be in the module.xml schema // and so Doctrine will have already dropped them. if (!empty($tab_modif[$fld_id]['drop'])) { - $sql_create .= "DROP COLUMN IF EXISTS {$row_fld}, "; + $sql_create .= "DROP COLUMN {$row_fld}, "; unset($tab_modif[$fld_id]['drop']); continue; } diff --git a/module.xml b/module.xml index 75c34a9..68ff878 100644 --- a/module.xml +++ b/module.xml @@ -1,7 +1,7 @@ sccp_manager SCCP Manager - 14.4.0.1 + 14.4.0.2 setup SCCP Connectivity Steve Lad, Alex GP @@ -38,6 +38,7 @@ * Version 14.3.0.30 * - Fix reversion in 29. Not returning to correct page when saving device. * Version 14.3.0.31 * - Fix rewrite rules. * Version 14.4.0.1 * - Modify installer to avoid data loss on existing 14.3 fields. Bump Minor version to reflect this. + * Version 14.4.0.2 * - Revert error in Installer db calls - IF EXISTS is not valid in MariaDb v5 (package DB) https://github.com/chan-sccp/sccp_manager