Leave table deletion to FreePBX

FreePBX and Director remove all tables that it has installed. If they do not exist, uninstaller gives errors
This commit is contained in:
steve-lad 2021-06-14 12:18:40 +02:00
parent 09db30fe9f
commit 9ac0d59c66

View file

@ -96,20 +96,14 @@ if (!empty($version)) {
sql("DELETE FROM kvstore WHERE module = 'Sccp_manager'");
}
}
outn("<li>" . _('Removing all Sccp_manager tables') . "</li>");
foreach ($sqlTables as $table) {
$sql = "DROP TABLE IF EXISTS {$table}";
$result = $db->query($sql);
if (DB::IsError($result)) {
die_freepbx($result->getDebugInfo());
}
$sql = "DROP VIEW IF EXISTS sccpdeviceconfig";
$result = $db->query($sql);
if (DB::IsError($result)) {
die_freepbx($result->getDebugInfo());
}
unset($result);
}
// FreePbx removes all tables via module.xml, and uninstaller will error
// If the tables do not exist.
//outn("<li>" . _('Removing all Sccp_manager tables') . "</li>");
//foreach ($sqlTables as $table) {
//$sql = "DROP TABLE IF EXISTS {$table}";
//}
outn("<li>" . _('Removing all Sccp_manager views') . "</li>");
$db->query("DROP VIEW IF EXISTS sccpdeviceconfig");
outn("<li>" . _("Uninstall Complete") . "</li>");
return true;
?>