global $CFG, $DB;
// first try normal delete
- if ($DB->get_manager()->delete_tables_from_xmldb_file($file)) {
+ if (file_exists($file) and $DB->get_manager()->delete_tables_from_xmldb_file($file)) {
return true;
}
continue;
}
+ if (strpos($table, $name) !== 0) {
+ continue;
+ }
+
// found orphan table --> delete it
if ($DB->get_manager()->table_exists($table)) {
$xmldb_table = new xmldb_table($table);