From 2a9b76b205e1b24700b85b4053d3f3a779c1bd1c Mon Sep 17 00:00:00 2001 From: fogelito Date: Wed, 7 Jun 2023 09:46:24 +0300 Subject: [PATCH] Separates for 2 queries --- src/Appwrite/Migration/Version/V19.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Appwrite/Migration/Version/V19.php b/src/Appwrite/Migration/Version/V19.php index 806f9a31c6..0dc35a639b 100644 --- a/src/Appwrite/Migration/Version/V19.php +++ b/src/Appwrite/Migration/Version/V19.php @@ -148,10 +148,13 @@ class V19 extends Migration $collectionName = "`{$this->projectDB->getDefaultDatabase()}`.`'_{$this->project->getInternalId()}_{$collectionName}_perms`"; try { - $this->pdo->prepare("ALTER TABLE {$collectionName} - DROP INDEX `_permission` , - ADD INDEX `_permission` (`_permission`, `_type`, `_document`); - ")->execute(); + $this->pdo->prepare("ALTER TABLE {$collectionName} DROP INDEX `_permission`")->execute(); + } catch (\Throwable $th) { + Console::warning($th->getMessage()); + } + + try { + $this->pdo->prepare("ALTER TABLE {$collectionName} ADD INDEX `_permission` (`_permission`, `_type`, `_document`)")->execute(); } catch (\Throwable $th) { Console::warning($th->getMessage()); }