From d64d7ece1262acf9ce4026625cfb734937e55627 Mon Sep 17 00:00:00 2001 From: Prem Palanisamy Date: Thu, 14 May 2026 17:24:32 +0100 Subject: [PATCH] Add project variable migration support Reports project-variable counts in MigrationReport and points the migration lib pin at the add-project-variable-migration dev branch. --- composer.json | 14 +++++-- composer.lock | 38 ++++++++++++++----- .../Utopia/Response/Model/MigrationReport.php | 6 +++ 3 files changed, 44 insertions(+), 14 deletions(-) diff --git a/composer.json b/composer.json index 37e7a1ae0e..67b0dfcf59 100644 --- a/composer.json +++ b/composer.json @@ -74,7 +74,7 @@ "utopia-php/locale": "0.8.*", "utopia-php/logger": "0.8.*", "utopia-php/messaging": "0.22.*", - "utopia-php/migration": "dev-add-api-key-migration as 1.12.0", + "utopia-php/migration": "dev-add-project-variable-migration as 1.12.0", "utopia-php/platform": "^1.0@RC", "utopia-php/pools": "1.*", "utopia-php/span": "1.1.*", @@ -112,11 +112,17 @@ "ext-phpiredis": "*" }, "config": { - "platform": { - }, + "platform": {}, "allow-plugins": { "php-http/discovery": true, "tbachert/spi": true } - } + }, + "repositories": [ + { + "name": "migration", + "type": "vcs", + "url": "https://github.com/utopia-php/migration" + } + ] } diff --git a/composer.lock b/composer.lock index 199710b788..02bc082abf 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": "70b7a6b3803660b7a8aa1a542f630b02", + "content-hash": "5bf93473859f86fbf9438b17cb660331", "packages": [ { "name": "adhocore/jwt", @@ -4606,16 +4606,16 @@ }, { "name": "utopia-php/migration", - "version": "dev-add-api-key-migration", + "version": "dev-add-project-variable-migration", "source": { "type": "git", "url": "https://github.com/utopia-php/migration.git", - "reference": "93715c256bf57cd93a1ef92e366c19f9a53ff21a" + "reference": "c040472abd3c9874017f18cb1589c3c26677451c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/migration/zipball/93715c256bf57cd93a1ef92e366c19f9a53ff21a", - "reference": "93715c256bf57cd93a1ef92e366c19f9a53ff21a", + "url": "https://api.github.com/repos/utopia-php/migration/zipball/c040472abd3c9874017f18cb1589c3c26677451c", + "reference": "c040472abd3c9874017f18cb1589c3c26677451c", "shasum": "" }, "require": { @@ -4641,7 +4641,25 @@ "Utopia\\Migration\\": "src/Migration" } }, - "notification-url": "https://packagist.org/downloads/", + "autoload-dev": { + "psr-4": { + "Utopia\\Tests\\": "tests/Migration" + } + }, + "scripts": { + "test": [ + "./vendor/bin/phpunit" + ], + "lint": [ + "./vendor/bin/pint --test" + ], + "format": [ + "./vendor/bin/pint" + ], + "check": [ + "./vendor/bin/phpstan analyse --level 3 src tests --memory-limit 2G" + ] + }, "license": [ "MIT" ], @@ -4654,10 +4672,10 @@ "utopia" ], "support": { - "issues": "https://github.com/utopia-php/migration/issues", - "source": "https://github.com/utopia-php/migration/tree/add-api-key-migration" + "source": "https://github.com/utopia-php/migration/tree/add-project-variable-migration", + "issues": "https://github.com/utopia-php/migration/issues" }, - "time": "2026-05-14T14:53:20+00:00" + "time": "2026-05-14T16:18:34+00:00" }, { "name": "utopia-php/mongo", @@ -8567,7 +8585,7 @@ "aliases": [ { "package": "utopia-php/migration", - "version": "dev-add-api-key-migration", + "version": "dev-add-project-variable-migration", "alias": "1.12.0", "alias_normalized": "1.12.0.0" } diff --git a/src/Appwrite/Utopia/Response/Model/MigrationReport.php b/src/Appwrite/Utopia/Response/Model/MigrationReport.php index 09380d8628..9de39d75bf 100644 --- a/src/Appwrite/Utopia/Response/Model/MigrationReport.php +++ b/src/Appwrite/Utopia/Response/Model/MigrationReport.php @@ -65,6 +65,12 @@ class MigrationReport extends Model 'default' => 0, 'example' => 5, ]) + ->addRule(Resource::TYPE_PROJECT_VARIABLE, [ + 'type' => self::TYPE_INTEGER, + 'description' => 'Number of project variables to be migrated.', + 'default' => 0, + 'example' => 5, + ]) ->addRule(Resource::TYPE_SITE, [ 'type' => self::TYPE_INTEGER, 'description' => 'Number of sites to be migrated.',