Fix tenant database adapter reuse

This commit is contained in:
Chirag Aggarwal
2026-05-20 09:58:35 +05:30
parent 329935aa7f
commit f18af04eae
+4 -1
View File
@@ -110,12 +110,15 @@ class DatabaseFactory
$projectDsn = $this->dsn($project->getAttribute('database'));
$databaseType = $databaseDocument->getAttribute('type', '');
$database = $this->newDatabase($this->adapter($databaseDsn->getHost()));
$database = $this->newDatabase(new DatabasePool($this->pools->get($databaseDsn->getHost())));
$database
->setDatabase($this->database)
->setAuthorization($this->authorization);
// This flag is adapter-level mutable state. Tenant databases can share the same
// pool name while requiring different attribute support (for example TablesDB
// versus DocumentsDB), so this adapter must not be reused from the factory cache.
$database->getAdapter()->setSupportForAttributes($databaseType !== DOCUMENTSDB);
if ($preserveDates) {