Fix database type handling and update dependencies in composer files

This commit is contained in:
ArnabChatterjee20k
2026-03-10 18:43:17 +05:30
parent 798c605492
commit 9989820e17
5 changed files with 18 additions and 26 deletions
+1 -1
View File
@@ -48,7 +48,7 @@ function getDatabaseTransferResourceServices(string $databaseType)
return match($databaseType) {
DATABASE_TYPE_LEGACY,
DATABASE_TYPE_TABLESDB => Transfer::GROUP_DATABASES_TABLES_DB,
DATABASE_TYPE_VECTORDB => Transfer::GROUP_DATABASES_VECTOR_DB,
DATABASE_TYPE_VECTORSDB => Transfer::GROUP_DATABASES_VECTOR_DB,
DATABASE_TYPE_DOCUMENTSDB => Transfer::GROUP_DATABASES_DOCUMENTS_DB
};
}
+6 -5
View File
@@ -222,18 +222,19 @@ Server::setResource('getLogsDB', function (Group $pools, Cache $cache, Authoriza
Server::setResource('getDatabasesDB', function (Cache $cache, Registry $register, Document $project, Authorization $authorization) {
return function (Document $database, ?Document $projectDocument = null) use ($cache, $register, $project, $authorization): Database {
$projectDocument ??= $project;
$databaseType = $database->getAttribute('database', '');
$databaseDSN = $database->getAttribute('database', '');
$databaseType = $database->getAttribute('type', '');
// Backwardscompatibility: older or seeded legacy databases may not have a DSN stored
// in the "database" attribute. In that case, fall back to the project's database DSN.
if ($databaseType === '') {
$databaseType = $projectDocument->getAttribute('database', '');
if ($databaseDSN === '') {
$databaseDSN = $projectDocument->getAttribute('database', '');
}
try {
$databaseDSN = new DSN($databaseType);
$databaseDSN = new DSN($databaseDSN);
} catch (\InvalidArgumentException) {
$databaseDSN = new DSN('mysql://'.$databaseType);
$databaseDSN = new DSN('mysql://'.$databaseDSN);
}
try {
+1 -1
View File
@@ -70,7 +70,7 @@
"utopia-php/locale": "0.8.*",
"utopia-php/logger": "0.6.*",
"utopia-php/messaging": "0.20.*",
"utopia-php/migration": "dev-multitype-db as 1.6.3",
"utopia-php/migration": "1.8.0",
"utopia-php/platform": "0.7.*",
"utopia-php/pools": "1.*",
"utopia-php/span": "1.1.*",
Generated
+9 -18
View File
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "1280bf4d25db19f63b96db9fcd39f60b",
"content-hash": "f6907572c33d73d7b98a29c4fe9ce652",
"packages": [
{
"name": "adhocore/jwt",
@@ -4517,16 +4517,16 @@
},
{
"name": "utopia-php/migration",
"version": "dev-multitype-db",
"version": "1.8.0",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/migration.git",
"reference": "4779fd6b25c4c681fc51f2a937a01984887d0bcf"
"reference": "b5626b9b05026b381345a6fac554a123b33084aa"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/migration/zipball/4779fd6b25c4c681fc51f2a937a01984887d0bcf",
"reference": "4779fd6b25c4c681fc51f2a937a01984887d0bcf",
"url": "https://api.github.com/repos/utopia-php/migration/zipball/b5626b9b05026b381345a6fac554a123b33084aa",
"reference": "b5626b9b05026b381345a6fac554a123b33084aa",
"shasum": ""
},
"require": {
@@ -4566,9 +4566,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/migration/issues",
"source": "https://github.com/utopia-php/migration/tree/multitype-db"
"source": "https://github.com/utopia-php/migration/tree/1.8.0"
},
"time": "2026-03-09T08:36:49+00:00"
"time": "2026-03-10T12:50:35+00:00"
},
{
"name": "utopia-php/mongo",
@@ -9106,18 +9106,9 @@
"time": "2024-03-07T20:33:40+00:00"
}
],
"aliases": [
{
"package": "utopia-php/migration",
"version": "dev-multitype-db",
"alias": "1.6.3",
"alias_normalized": "1.6.3.0"
}
],
"aliases": [],
"minimum-stability": "dev",
"stability-flags": {
"utopia-php/migration": 20
},
"stability-flags": {},
"prefer-stable": true,
"prefer-lowest": false,
"platform": {
+1 -1
View File
@@ -1338,7 +1338,7 @@ services:
ollama:
build:
context: https://github.com/appwrite/docker-ollama.git#feat-dockerfile
context: appwrite/ollama:0.1.0
args:
MODELS: ${_APP_EMBEDDING_MODELS:-embeddinggemma}
# duration to keep model in memory