From 86843355dced5e4ad763b19764a766a3821fb6b2 Mon Sep 17 00:00:00 2001 From: Prem Palanisamy Date: Sat, 14 Mar 2026 23:10:53 +0000 Subject: [PATCH] Fix syntax errors and add projectInternalId constructor param --- src/Migration/Destinations/Appwrite.php | 5 ++++- src/Migration/Sources/Appwrite.php | 11 +++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/Migration/Destinations/Appwrite.php b/src/Migration/Destinations/Appwrite.php index b974e177a7..32de97586b 100644 --- a/src/Migration/Destinations/Appwrite.php +++ b/src/Migration/Destinations/Appwrite.php @@ -102,6 +102,7 @@ class Appwrite extends Destination callable $getDatabasesDB, protected array $collectionStructure, protected UtopiaDatabase $dbForPlatform, + protected string $projectInternalId, ) { $this->project = $project; $this->endpoint = $endpoint; @@ -2237,7 +2238,7 @@ class Appwrite extends Destination $this->dbForPlatform->createDocument('platforms', new UtopiaDocument([ '$id' => ID::unique(), '$permissions' => $resource->getPermissions(), - 'projectInternalId' => $this->dbForPlatform->getDocument('projects', $this->project)->getInternalId(), + 'projectInternalId' => $this->projectInternalId, 'projectId' => $this->project, 'type' => $resource->getType(), 'name' => $resource->getPlatformName(), @@ -2255,6 +2256,8 @@ class Appwrite extends Destination $this->dbForPlatform->purgeCachedDocument('projects', $this->project); return true; + } + private function validateFieldsForIndexes(Index $resource, UtopiaDocument $table, array &$lengths) { /** diff --git a/src/Migration/Sources/Appwrite.php b/src/Migration/Sources/Appwrite.php index 7fed217d9c..1f51fa6b97 100644 --- a/src/Migration/Sources/Appwrite.php +++ b/src/Migration/Sources/Appwrite.php @@ -2247,6 +2247,10 @@ class Appwrite extends Source } catch (\Throwable) { $report[Resource::TYPE_PLATFORM] = 0; } + } + } + + /** * @param string $databaseType * @param array $database { * id: string, @@ -2308,6 +2312,10 @@ class Appwrite extends Source code: $e->getCode(), previous: $e )); + } + } + + /** * eg., tables,collections * @param string $databaseType * @param array{ @@ -2364,6 +2372,9 @@ class Appwrite extends Source } $this->callback($platforms); + } + + /** * eg.,documents/attributes * @param string $databaseType * @param array{