From 2d41a3353df10579822dc9e20cb3b5d3102e4087 Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Fri, 10 Oct 2025 20:29:05 +0530 Subject: [PATCH] * migration fix for tablesdb, legacy with multitype callback * updated patch script --- composer.lock | 8 ++++---- src/Appwrite/Migration/Version/V23.php | 10 +--------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/composer.lock b/composer.lock index 7f7466a947..0b55a5da4b 100644 --- a/composer.lock +++ b/composer.lock @@ -4350,12 +4350,12 @@ "source": { "type": "git", "url": "https://github.com/utopia-php/migration.git", - "reference": "262c1c2c72d7429e504cde53b2b1774da8e9998c" + "reference": "f072649b1102b3657f6624fac4e9a0ababfceeee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/migration/zipball/262c1c2c72d7429e504cde53b2b1774da8e9998c", - "reference": "262c1c2c72d7429e504cde53b2b1774da8e9998c", + "url": "https://api.github.com/repos/utopia-php/migration/zipball/f072649b1102b3657f6624fac4e9a0ababfceeee", + "reference": "f072649b1102b3657f6624fac4e9a0ababfceeee", "shasum": "" }, "require": { @@ -4398,7 +4398,7 @@ "issues": "https://github.com/utopia-php/migration/issues", "source": "https://github.com/utopia-php/migration/tree/feat-documents-db" }, - "time": "2025-10-07T14:52:08+00:00" + "time": "2025-10-10T14:52:21+00:00" }, { "name": "utopia-php/mongo", diff --git a/src/Appwrite/Migration/Version/V23.php b/src/Appwrite/Migration/Version/V23.php index 2e0090b3a0..98a60d9d74 100644 --- a/src/Appwrite/Migration/Version/V23.php +++ b/src/Appwrite/Migration/Version/V23.php @@ -8,7 +8,6 @@ use Throwable; use Utopia\CLI\Console; use Utopia\Database\Database; use Utopia\Database\Document; -use Utopia\System\System; class V23 extends Migration { @@ -50,14 +49,7 @@ class V23 extends Migration $this->dbForProject->updateDocuments('databases', new Document(['type' => 'legacy'])); // database dsn - $database = System::getEnv('_APP_DATABASE_NAME', 'appwrite'); - $namespace = System::getEnv('_APP_DATABASE_SHARED_NAMESPACE', ''); - $schema = System::getEnv('_APP_DB_HOST', 'mariadb'); - $dsn = $schema . '://' . $database; - if (!empty($namespace)) { - $dsn .= '?namespace=' . $namespace; - } $this->createAttributeFromCollection($this->dbForProject, 'databases', 'database'); - $this->dbForProject->updateDocuments('databases', new Document(['database' => $dsn])); + $this->dbForProject->updateDocuments('databases', new Document(['database' => $this->project->getAttribute('database')])); } }