From e6a1487fae8816500fd22c43367f2678ba7ccdf9 Mon Sep 17 00:00:00 2001 From: ralf Date: Sun, 20 Oct 2024 14:14:11 +0200 Subject: [PATCH] do NOT stall, if restore contains Guacamole tables, but current installation does not (they only get truncated, but not created) --- api/src/Db/Backup.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/api/src/Db/Backup.php b/api/src/Db/Backup.php index 2b11370b9f..f88fad7b0f 100644 --- a/api/src/Db/Backup.php +++ b/api/src/Db/Backup.php @@ -567,7 +567,12 @@ class Backup // do NOT create GUACAMOLE tables, just truncate them (as we have no abstraction to create the foreign keys) if (preg_match(self::GUACAMOLE_REGEXP, $table_name)) { - $this->db->query('TRUNCATE TABLE '.$this->db->name_quote($table_name)); + try { + $this->db->query('TRUNCATE TABLE '.$this->db->name_quote($table_name)); + } + catch (Exception $e) { + echo "

Failed to TRUNCATE TABLE $table_name: ".$e->getMessage()."

\n"; + } continue; } // if column is longtext in current schema, convert text to longtext, in case user already updated column