From 2c15f0bc7bf1b7e077b706426fb8bd3038a8607a Mon Sep 17 00:00:00 2001 From: Shmuel Fogel Date: Wed, 21 Jun 2023 09:43:29 +0300 Subject: [PATCH] Update src/Appwrite/Migration/Version/V19.php Co-authored-by: Jake Barnby --- src/Appwrite/Migration/Version/V19.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Appwrite/Migration/Version/V19.php b/src/Appwrite/Migration/Version/V19.php index 2e52539c91..d53c132ecc 100644 --- a/src/Appwrite/Migration/Version/V19.php +++ b/src/Appwrite/Migration/Version/V19.php @@ -107,9 +107,11 @@ class V19 extends Migration protected function alterPermissionIndex($collectionName): void { try { - $this->pdo->prepare("ALTER TABLE `{$this->projectDB->getDefaultDatabase()}`.`_{$this->project->getInternalId()}_{$collectionName}_perms` - DROP INDEX `_permission`, - ADD INDEX `_permission` (`_permission`, `_type`, `_document`) + $table = "`{$this->projectDB->getDefaultDatabase()}`.`_{$this->project->getInternalId()}_{$collectionName}_perms"; + $this->pdo->prepare(" + ALTER TABLE {$table} + DROP INDEX `_permission`, + ADD INDEX `_permission` (`_permission`, `_type`, `_document`); ")->execute(); } catch (\Throwable $th) { Console::warning($th->getMessage());