diff --git a/composer.json b/composer.json index f13b5577ac..c642f5079f 100644 --- a/composer.json +++ b/composer.json @@ -73,7 +73,7 @@ "utopia-php/locale": "0.8.*", "utopia-php/logger": "0.6.*", "utopia-php/messaging": "0.20.*", - "utopia-php/migration": "1.8.*", + "utopia-php/migration": "dev-feat-query-lib as 1.8.0", "utopia-php/platform": "0.7.*", "utopia-php/pools": "1.*", "utopia-php/span": "1.1.*", @@ -115,6 +115,10 @@ { "type": "vcs", "url": "https://github.com/utopia-php/async.git" + }, + { + "type": "vcs", + "url": "https://github.com/utopia-php/migration.git" } ], "config": { diff --git a/composer.lock b/composer.lock index 5b7f1bd971..c07cb1efaf 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": "a51e9764f643f4283d593e63f61cb4e5", + "content-hash": "9d66f869fc3ff5abc5873a31e6976911", "packages": [ { "name": "adhocore/jwt", @@ -4704,16 +4704,16 @@ }, { "name": "utopia-php/migration", - "version": "1.8.3", + "version": "dev-feat-query-lib", "source": { "type": "git", "url": "https://github.com/utopia-php/migration.git", - "reference": "8633523b3343d492427331b6eec53f020f6ab7a7" + "reference": "7c0e2d4f065c72f8b8424bbc06cb4aecbf28915a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/migration/zipball/8633523b3343d492427331b6eec53f020f6ab7a7", - "reference": "8633523b3343d492427331b6eec53f020f6ab7a7", + "url": "https://api.github.com/repos/utopia-php/migration/zipball/7c0e2d4f065c72f8b8424bbc06cb4aecbf28915a", + "reference": "7c0e2d4f065c72f8b8424bbc06cb4aecbf28915a", "shasum": "" }, "require": { @@ -4722,7 +4722,7 @@ "ext-openssl": "*", "halaxa/json-machine": "^1.2", "php": ">=8.1", - "utopia-php/database": "5.*", + "utopia-php/database": "dev-feat-query-lib as 5.3.17", "utopia-php/dsn": "0.2.*", "utopia-php/storage": "1.0.*" }, @@ -4739,7 +4739,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" ], @@ -4752,10 +4770,10 @@ "utopia" ], "support": { - "issues": "https://github.com/utopia-php/migration/issues", - "source": "https://github.com/utopia-php/migration/tree/1.8.3" + "source": "https://github.com/utopia-php/migration/tree/feat-query-lib", + "issues": "https://github.com/utopia-php/migration/issues" }, - "time": "2026-03-19T09:18:47+00:00" + "time": "2026-03-31T11:14:26+00:00" }, { "name": "utopia-php/mongo", @@ -8678,12 +8696,19 @@ "version": "dev-feat-query-lib", "alias": "5.3.17", "alias_normalized": "5.3.17.0" + }, + { + "package": "utopia-php/migration", + "version": "dev-feat-query-lib", + "alias": "1.8.0", + "alias_normalized": "1.8.0.0" } ], "minimum-stability": "dev", "stability-flags": { "utopia-php/audit": 20, - "utopia-php/database": 20 + "utopia-php/database": 20, + "utopia-php/migration": 20 }, "prefer-stable": true, "prefer-lowest": false, diff --git a/src/Appwrite/Utopia/Database/Hooks/Metadata.php b/src/Appwrite/Utopia/Database/Hooks/Metadata.php index 23601ee1ff..0b6f928dcb 100644 --- a/src/Appwrite/Utopia/Database/Hooks/Metadata.php +++ b/src/Appwrite/Utopia/Database/Hooks/Metadata.php @@ -39,7 +39,6 @@ class Metadata implements Decorator $this->operations++; $collectionId = $collection->getId(); - $document->removeAttribute('$collection'); $document->setAttribute('$databaseId', $this->database->getId()); $document->setAttribute('$' . $this->context . 'Id', $collectionId); @@ -90,7 +89,6 @@ class Metadata implements Decorator foreach ($relations as $relation) { if ($relation instanceof Document) { $this->operations++; - $relation->removeAttribute('$collection'); $relation->setAttribute('$databaseId', $this->database->getId()); $relation->setAttribute('$' . $this->context . 'Id', $relatedCollectionId); diff --git a/src/Appwrite/Utopia/Database/Hooks/UserEvents.php b/src/Appwrite/Utopia/Database/Hooks/UserEvents.php index 79878efe3a..a3eec08ca0 100644 --- a/src/Appwrite/Utopia/Database/Hooks/UserEvents.php +++ b/src/Appwrite/Utopia/Database/Hooks/UserEvents.php @@ -39,6 +39,7 @@ class UserEvents implements Lifecycle } $this->events + ->setProject($this->project) ->setEvent('users.[userId].create') ->setParam('userId', $data->getId()) ->setPayload($this->response->output($data, Response::MODEL_USER)); @@ -53,7 +54,7 @@ class UserEvents implements Lifecycle ->trigger(); } - if ($this->events->getProject()->getId() !== 'console') { + if ($this->project->getId() !== 'console') { $this->realtime ->from($this->events) ->trigger();