Merge pull request #1576 from TorstenDittmann/fix-migration-warning

fix(migration): better warning message
This commit is contained in:
Torsten Dittmann 2021-09-03 11:43:57 +02:00 committed by GitHub
commit 1a0b108f56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -97,15 +97,14 @@ abstract class Migration
foreach ($all as $document) {
go(function () use ($document, $callback) {
if (empty($document->getId()) || empty($document->getCollection())) {
Console::warning('Skipped Document due to missing ID or Collection.');
return;
}
$old = $document->getArrayCopy();
$new = call_user_func($callback, $document);
if (empty($new->getId())) {
Console::warning('Skipped Document due to missing ID.');
return;
}
if (!$this->check_diff_multi($new->getArrayCopy(), $old)) {
return;
}