fix(migration): better warning message
This commit is contained in:
parent
c6b54f111b
commit
54aea7d75d
1 changed files with 4 additions and 5 deletions
|
@ -97,15 +97,14 @@ abstract class Migration
|
||||||
|
|
||||||
foreach ($all as $document) {
|
foreach ($all as $document) {
|
||||||
go(function () use ($document, $callback) {
|
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();
|
$old = $document->getArrayCopy();
|
||||||
$new = call_user_func($callback, $document);
|
$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)) {
|
if (!$this->check_diff_multi($new->getArrayCopy(), $old)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue