From fd625fca7b9a4d54e118467f28305d750136e269 Mon Sep 17 00:00:00 2001 From: Prem Palanisamy Date: Sun, 10 May 2026 22:09:39 +0100 Subject: [PATCH] fix(migrations): preserve source DSN for documentsdb/vectorsdb resolver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Migration lib 1.10.2's getDatabaseDSN resolver returns the value written into destination's _databases.database. The previous resolver always returned the project's main DSN (mongodb in default CI) for every database type, including documentsdb / vectorsdb — which are routed to their own adapters (mongodb / postgresql) per _APP_DB_ADAPTER_DOCUMENTSDB / _APP_DB_ADAPTER_VECTORSDB. The wrong DSN routed vectorsdb attribute creates back to mongodb, producing 'Vector types are not supported by the current database' on the MixedDatabases / VectorsDB migration tests. Mirror cloud's resolver: keep the source DSN for documentsdb / vectorsdb (they target dedicated hosts), use destination project's main DSN otherwise. --- src/Appwrite/Platform/Workers/Migrations.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Appwrite/Platform/Workers/Migrations.php b/src/Appwrite/Platform/Workers/Migrations.php index ddb5900f2e..41f82f4dd0 100644 --- a/src/Appwrite/Platform/Workers/Migrations.php +++ b/src/Appwrite/Platform/Workers/Migrations.php @@ -293,7 +293,10 @@ class Migrations extends Action $this->getDatabasesDB, Config::getParam('collections', [])['databases']['collections'], OnDuplicate::tryFrom($options['onDuplicate'] ?? '') ?? OnDuplicate::Fail, - fn () => (string) $this->project->getAttribute('database', ''), + fn (ResourceDatabase $resource) => match ($resource->getType()) { + DATABASE_TYPE_DOCUMENTSDB, DATABASE_TYPE_VECTORSDB => (string) $resource->getDatabase(), + default => (string) $this->project->getAttribute('database', ''), + }, ), DestinationCSV::getName() => new DestinationCSV( $this->deviceForFiles,