Skip to content

Commit 546de5a

Browse files
committed
Modify installer db calls to remove IF EXISTS
IF EXISTS is not correct in MariaDb v5, used in all FreePbx Packages.
1 parent b1769e6 commit 546de5a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

install.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ function InstallDB_updateSchema($db_config)
433433
}
434434
// Processed all _Column names; now safe to delete them
435435
$sqlDrop = array_reduce($fieldsArr, function($carry, $column) {
436-
return "${carry} DROP COLUMN IF EXISTS ${column},";
436+
return "${carry} DROP COLUMN ${column},";
437437
});
438438
$sqlDrop = rtrim($sqlDrop, ", ");
439439
$stmt = $db->prepare("ALTER TABLE ${table} ${sqlDrop}");
@@ -463,7 +463,7 @@ function InstallDB_updateSchema($db_config)
463463
// occur as columns that are dropped should no longer be in the module.xml schema
464464
// and so Doctrine will have already dropped them.
465465
if (!empty($tab_modif[$fld_id]['drop'])) {
466-
$sql_create .= "DROP COLUMN IF EXISTS {$row_fld}, ";
466+
$sql_create .= "DROP COLUMN {$row_fld}, ";
467467
unset($tab_modif[$fld_id]['drop']);
468468
continue;
469469
}

module.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<module>
22
<rawname>sccp_manager</rawname>
33
<name>SCCP Manager</name>
4-
<version>14.4.0.1</version>
4+
<version>14.4.0.2</version>
55
<type>setup</type>
66
<category>SCCP Connectivity</category>
77
<publisher>Steve Lad, Alex GP</publisher>
@@ -38,6 +38,7 @@
3838
* Version 14.3.0.30 * - Fix reversion in 29. Not returning to correct page when saving device.
3939
* Version 14.3.0.31 * - Fix rewrite rules.
4040
* Version 14.4.0.1 * - Modify installer to avoid data loss on existing 14.3 fields. Bump Minor version to reflect this.
41+
* Version 14.4.0.2 * - Revert error in Installer db calls - IF EXISTS is not valid in MariaDb v5 (package DB)
4142
</changelog>
4243
<location>https://github.com/chan-sccp/sccp_manager</location>
4344
<depends>

0 commit comments

Comments
 (0)