mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
fix(migrations): preserve source DSN for documentsdb/vectorsdb resolver
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.
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user