From c8a7ed202281895f6fa256fd71ed108cb27d27e1 Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Tue, 24 Feb 2026 10:43:10 +0530 Subject: [PATCH] updated migration to remove the dependency on dsn at project level attribute --- composer.json | 2 +- composer.lock | 20 ++++++++++---------- src/Appwrite/Platform/Workers/Migrations.php | 10 ---------- 3 files changed, 11 insertions(+), 21 deletions(-) diff --git a/composer.json b/composer.json index b75af0ec2b..8145fa467f 100644 --- a/composer.json +++ b/composer.json @@ -69,7 +69,7 @@ "utopia-php/locale": "0.8.*", "utopia-php/logger": "0.6.*", "utopia-php/messaging": "0.20.*", - "utopia-php/migration": "dev-improve-columns-setup as 1.6.1", + "utopia-php/migration": "dev-remove-dsn-callables as 1.6.2", "utopia-php/platform": "0.7.*", "utopia-php/pools": "1.*", "utopia-php/span": "1.1.*", diff --git a/composer.lock b/composer.lock index 4ba5f96947..2dc1dc1aa9 100644 --- a/composer.lock +++ b/composer.lock @@ -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": "9982b1af032ade7b23f2aa5c4cf69432", + "content-hash": "1f4033f1f09f0ddc0b040d3f1af0dfb0", "packages": [ { "name": "adhocore/jwt", @@ -4518,16 +4518,16 @@ }, { "name": "utopia-php/migration", - "version": "dev-improve-columns-setup", + "version": "dev-remove-dsn-callables", "source": { "type": "git", "url": "https://github.com/utopia-php/migration.git", - "reference": "e4872c17cb5dcf56807f267b04c00006268fce1b" + "reference": "682cdc36618a2be4fe376047a6250a3d0c4ea739" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/migration/zipball/e4872c17cb5dcf56807f267b04c00006268fce1b", - "reference": "e4872c17cb5dcf56807f267b04c00006268fce1b", + "url": "https://api.github.com/repos/utopia-php/migration/zipball/682cdc36618a2be4fe376047a6250a3d0c4ea739", + "reference": "682cdc36618a2be4fe376047a6250a3d0c4ea739", "shasum": "" }, "require": { @@ -4567,9 +4567,9 @@ ], "support": { "issues": "https://github.com/utopia-php/migration/issues", - "source": "https://github.com/utopia-php/migration/tree/improve-columns-setup" + "source": "https://github.com/utopia-php/migration/tree/remove-dsn-callables" }, - "time": "2026-02-18T10:30:45+00:00" + "time": "2026-02-24T05:05:52+00:00" }, { "name": "utopia-php/mongo", @@ -8940,9 +8940,9 @@ "aliases": [ { "package": "utopia-php/migration", - "version": "dev-improve-columns-setup", - "alias": "1.6.1", - "alias_normalized": "1.6.1.0" + "version": "dev-remove-dsn-callables", + "alias": "1.6.2", + "alias_normalized": "1.6.2.0" } ], "minimum-stability": "dev", diff --git a/src/Appwrite/Platform/Workers/Migrations.php b/src/Appwrite/Platform/Workers/Migrations.php index 1df945a11f..2e2600a36a 100644 --- a/src/Appwrite/Platform/Workers/Migrations.php +++ b/src/Appwrite/Platform/Workers/Migrations.php @@ -258,7 +258,6 @@ class Migrations extends Action protected function processDestination(Document $migration): Destination { $destination = $migration->getAttribute('destination'); - $getDatabaseDSN = fn (string $databaseType): string => $this->getDatabaseDSN($databaseType); $options = $migration->getAttribute('options', []); $credentials = $migration->getAttribute('credentials'); @@ -269,7 +268,6 @@ class Migrations extends Action $credentials['destinationApiKey'], $this->dbForProject, $this->getDatabasesDB, - $getDatabaseDSN, Config::getParam('collections', [])['databases']['collections'], ), DestinationCSV::getName() => new DestinationCSV( @@ -549,14 +547,6 @@ class Migrations extends Action return call_user_func($this->getDatabasesDB, $database); } - protected function getDatabaseDSN(string $databaseType): string - { - return match ($databaseType) { - 'documentsdb' => $this->project->getAttribute('documentsDatabase'), - 'vectordb' => $this->project->getAttribute('vectorDatabase'), - default => $this->project->getAttribute('database'), - }; - } /** * Handle actions to be performed when a CSV export migration is successfully completed *