1
0
Fork 0
mirror of synced 2024-06-26 10:10:57 +12:00

fix(migration): better warning message

This commit is contained in:
Torsten Dittmann 2021-09-03 10:36:58 +02:00
parent c6b54f111b
commit 54aea7d75d

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;
}