From f4718e26cb073b145f9333dd6a1655b402797ab2 Mon Sep 17 00:00:00 2001 From: Prem Palanisamy Date: Thu, 14 May 2026 14:14:25 +0100 Subject: [PATCH] Query keys by resourceInternalId/resourceType, not projectInternalId projectInternalId is a written-but-not-queryable legacy column on the keys collection (upstream filter uses resourceInternalId + resourceType). Mirror that here so the duplicate-check find() doesn't error out. --- src/Migration/Destinations/Appwrite.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Migration/Destinations/Appwrite.php b/src/Migration/Destinations/Appwrite.php index 304366fbfb..f71a2561f3 100644 --- a/src/Migration/Destinations/Appwrite.php +++ b/src/Migration/Destinations/Appwrite.php @@ -3135,7 +3135,8 @@ class Appwrite extends Destination protected function createApiKey(ApiKey $resource): bool { $existing = $this->dbForPlatform->findOne('keys', [ - Query::equal('projectInternalId', [$this->projectInternalId]), + Query::equal('resourceType', ['projects']), + Query::equal('resourceInternalId', [$this->projectInternalId]), Query::equal('name', [$resource->getApiKeyName()]), ]);