From 4160827f92671cd0e466be7ce82e8ed33c445941 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 4 Jan 2022 19:36:06 +0100 Subject: [PATCH] fix: migration --- src/Appwrite/Migration/Version/V11.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Appwrite/Migration/Version/V11.php b/src/Appwrite/Migration/Version/V11.php index f36bad9de..a4a258671 100644 --- a/src/Appwrite/Migration/Version/V11.php +++ b/src/Appwrite/Migration/Version/V11.php @@ -273,7 +273,7 @@ class V11 extends Migration 'permission' => 'document', 'dateCreated' => time(), 'dateUpdated' => time(), - 'name' => $name, + 'name' => substr($name, 0, 256), 'enabled' => true, 'search' => implode(' ', [$id, $name]), ])); @@ -442,6 +442,11 @@ class V11 extends Migration $providers = Config::getParam('providers', []); $auths = Config::getParam('auth', []); + /** + * Remove Tasks + */ + $document->removeAttribute('tasks'); + /* * Add enabled OAuth2 providers to default data rules */ @@ -473,9 +478,9 @@ class V11 extends Migration ]; foreach ($oldAuths as $index => $auth) { - $enabled = $document->getAttribute(\ucfirst($auth), true); + $enabled = $document->getAttribute($auth, true); $newAuths['auth'.\ucfirst($auths[$index]['key'])] = $enabled; - $document->removeAttribute(\ucfirst($auth)); + $document->removeAttribute($auth); } if (!empty($document->getAttribute('usersAuthLimit'))) { @@ -486,7 +491,7 @@ class V11 extends Migration $document->setAttribute('auths', $newProviders); break; - case OldDatabase::SYSTEM_COLLECTION_PLATFORMS: + case OldDatabase::SYSTEM_COLLECTION_PLATFORMS: $projectId = $this->getProjectIdFromReadPermissions($document); /**