Add resourceId to migration collections.php

This commit is contained in:
fogelito 2024-07-15 17:22:36 +03:00
parent 6a717f2272
commit d9da0dd671
2 changed files with 25 additions and 22 deletions

32
composer.lock generated
View file

@ -2175,12 +2175,12 @@
"source": {
"type": "git",
"url": "https://github.com/utopia-php/migration.git",
"reference": "2b491d582f316ca7670c4c23f01259482c0ff2a3"
"reference": "a7dc26f65866d022451a17860d50e29123edd7e4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/migration/zipball/2b491d582f316ca7670c4c23f01259482c0ff2a3",
"reference": "2b491d582f316ca7670c4c23f01259482c0ff2a3",
"url": "https://api.github.com/repos/utopia-php/migration/zipball/a7dc26f65866d022451a17860d50e29123edd7e4",
"reference": "a7dc26f65866d022451a17860d50e29123edd7e4",
"shasum": ""
},
"require": {
@ -2222,7 +2222,7 @@
"issues": "https://github.com/utopia-php/migration/issues",
"source": "https://github.com/utopia-php/migration/tree/backups"
},
"time": "2024-06-26T07:48:24+00:00"
"time": "2024-07-15T11:52:33+00:00"
},
{
"name": "utopia-php/mongo",
@ -3165,16 +3165,16 @@
},
{
"name": "laravel/pint",
"version": "v1.16.1",
"version": "v1.16.2",
"source": {
"type": "git",
"url": "https://github.com/laravel/pint.git",
"reference": "9266a47f1b9231b83e0cfd849009547329d871b1"
"reference": "51f1ba679a6afe0315621ad143d788bd7ded0eca"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/pint/zipball/9266a47f1b9231b83e0cfd849009547329d871b1",
"reference": "9266a47f1b9231b83e0cfd849009547329d871b1",
"url": "https://api.github.com/repos/laravel/pint/zipball/51f1ba679a6afe0315621ad143d788bd7ded0eca",
"reference": "51f1ba679a6afe0315621ad143d788bd7ded0eca",
"shasum": ""
},
"require": {
@ -3227,7 +3227,7 @@
"issues": "https://github.com/laravel/pint/issues",
"source": "https://github.com/laravel/pint"
},
"time": "2024-06-18T16:50:05+00:00"
"time": "2024-07-09T15:58:08+00:00"
},
{
"name": "matthiasmullie/minify",
@ -3415,16 +3415,16 @@
},
{
"name": "nikic/php-parser",
"version": "v5.0.2",
"version": "v5.1.0",
"source": {
"type": "git",
"url": "https://github.com/nikic/PHP-Parser.git",
"reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13"
"reference": "683130c2ff8c2739f4822ff7ac5c873ec529abd1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/139676794dc1e9231bf7bcd123cfc0c99182cb13",
"reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/683130c2ff8c2739f4822ff7ac5c873ec529abd1",
"reference": "683130c2ff8c2739f4822ff7ac5c873ec529abd1",
"shasum": ""
},
"require": {
@ -3435,7 +3435,7 @@
},
"require-dev": {
"ircmaxell/php-yacc": "^0.0.7",
"phpunit/phpunit": "^7.0 || ^8.0 || ^9.0"
"phpunit/phpunit": "^9.0"
},
"bin": [
"bin/php-parse"
@ -3467,9 +3467,9 @@
],
"support": {
"issues": "https://github.com/nikic/PHP-Parser/issues",
"source": "https://github.com/nikic/PHP-Parser/tree/v5.0.2"
"source": "https://github.com/nikic/PHP-Parser/tree/v5.1.0"
},
"time": "2024-03-05T20:51:40+00:00"
"time": "2024-07-01T20:03:41+00:00"
},
{
"name": "phar-io/manifest",

View file

@ -313,12 +313,15 @@ class Migrations extends Action
$log->addBreadcrumb(new Breadcrumb("debug", "migration", "Migration hit stage 'migrating'", \microtime(true)));
$this->updateMigrationDocument($migration, $projectDocument);
$transfer->run($migration->getAttribute('resources'), function () use ($migration, $transfer, $projectDocument) {
$migration->setAttribute('resourceData', json_encode($transfer->getCache()));
$migration->setAttribute('statusCounters', json_encode($transfer->getStatusCounters()));
$this->updateMigrationDocument($migration, $projectDocument);
});
$transfer->run(
$migration->getAttribute('resources'),
function () use ($migration, $transfer, $projectDocument) {
$migration->setAttribute('resourceData', json_encode($transfer->getCache()));
$migration->setAttribute('statusCounters', json_encode($transfer->getStatusCounters()));
$this->updateMigrationDocument($migration, $projectDocument);
},
$migration->getAttribute('resourceId', '')
);
$destination->shutDown();
$source->shutDown();