From 4ddd1bd82021a8909cfdfc06a2b938b6ae5148b2 Mon Sep 17 00:00:00 2001 From: fogelito Date: Sun, 1 Dec 2024 09:47:41 +0200 Subject: [PATCH 1/3] Remove DROP TABLE IF EXISTS --- src/Database/Adapter/MariaDB.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Database/Adapter/MariaDB.php b/src/Database/Adapter/MariaDB.php index e0e514fcc..508835f8d 100644 --- a/src/Database/Adapter/MariaDB.php +++ b/src/Database/Adapter/MariaDB.php @@ -215,11 +215,11 @@ public function createCollection(string $name, array $attributes = [], array $in } catch (PDOException $e) { $e = $this->processException($e); - if (!($e instanceof DuplicateException)) { - $this->getPDO() - ->prepare("DROP TABLE IF EXISTS {$this->getSQLTable($id)}, {$this->getSQLTable($id . '_perms')};") - ->execute(); - } +// if (!($e instanceof DuplicateException)) { +// $this->getPDO() +// ->prepare("DROP TABLE IF EXISTS {$this->getSQLTable($id)}, {$this->getSQLTable($id . '_perms')};") +// ->execute(); +// } throw $e; } From 8efa45c6c1d169e31db9b87605350be94ef492ad Mon Sep 17 00:00:00 2001 From: fogelito Date: Sun, 1 Dec 2024 09:51:12 +0200 Subject: [PATCH 2/3] lint --- src/Database/Adapter/MariaDB.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Database/Adapter/MariaDB.php b/src/Database/Adapter/MariaDB.php index 508835f8d..d2f26ead1 100644 --- a/src/Database/Adapter/MariaDB.php +++ b/src/Database/Adapter/MariaDB.php @@ -215,11 +215,11 @@ public function createCollection(string $name, array $attributes = [], array $in } catch (PDOException $e) { $e = $this->processException($e); -// if (!($e instanceof DuplicateException)) { -// $this->getPDO() -// ->prepare("DROP TABLE IF EXISTS {$this->getSQLTable($id)}, {$this->getSQLTable($id . '_perms')};") -// ->execute(); -// } + // if (!($e instanceof DuplicateException)) { + // $this->getPDO() + // ->prepare("DROP TABLE IF EXISTS {$this->getSQLTable($id)}, {$this->getSQLTable($id . '_perms')};") + // ->execute(); + // } throw $e; } From b9940b0b38bea8baef89b60399358fac3dc44023 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Mon, 2 Dec 2024 14:31:19 +1300 Subject: [PATCH 3/3] Remove comment --- src/Database/Adapter/MariaDB.php | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/Database/Adapter/MariaDB.php b/src/Database/Adapter/MariaDB.php index d2f26ead1..90ea0ae8c 100644 --- a/src/Database/Adapter/MariaDB.php +++ b/src/Database/Adapter/MariaDB.php @@ -213,15 +213,7 @@ public function createCollection(string $name, array $attributes = [], array $in ->prepare($permissions) ->execute(); } catch (PDOException $e) { - $e = $this->processException($e); - - // if (!($e instanceof DuplicateException)) { - // $this->getPDO() - // ->prepare("DROP TABLE IF EXISTS {$this->getSQLTable($id)}, {$this->getSQLTable($id . '_perms')};") - // ->execute(); - // } - - throw $e; + throw $this->processException($e); } return true;