diff options
author | Carl Schwan <carl@carlschwan.eu> | 2022-05-09 13:03:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-09 13:03:00 +0200 |
commit | 293f028a19a69a667351958b4b9da407da4c4d79 (patch) | |
tree | 8c01ea31652648e5648c4fac79239769442c6048 | |
parent | fbbb9165b0bd671f3eb7c1b0395a05756f5a3c0d (diff) | |
parent | 17666a5f74c93d63212a8eb78a13c6ff8358be28 (diff) |
Merge pull request #1330 from stefan123t/master
fix #1129 empty only existing tables in emptyAll()
-rw-r--r-- | lib/Db/CoreRequestBuilder.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Db/CoreRequestBuilder.php b/lib/Db/CoreRequestBuilder.php index f4ffd2cd..dc81ce0d 100644 --- a/lib/Db/CoreRequestBuilder.php +++ b/lib/Db/CoreRequestBuilder.php @@ -1164,10 +1164,11 @@ class CoreRequestBuilder { */ public function emptyAll() { foreach ($this->tables as $table) { - $qb = $this->dbConnection->getQueryBuilder(); - $qb->delete($table); - - $qb->execute(); + if ($schema->hasTable($table)) { + $qb = $this->dbConnection->getQueryBuilder(); + $qb->delete($table); + $qb->execute(); + } } } |