Update src/Appwrite/Migration/Version/V19.php

Co-authored-by: Jake Barnby <jakeb994@gmail.com>
This commit is contained in:
Shmuel Fogel 2023-06-21 09:43:29 +03:00 committed by GitHub
parent 5ae534d291
commit 2c15f0bc7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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());