1
0
Fork 0
mirror of synced 2024-05-20 12:42:39 +12:00

fix: migration dont stop on exception

This commit is contained in:
Torsten Dittmann 2021-12-30 10:59:58 +01:00
parent ba50075fff
commit f65441fb83

View file

@ -202,7 +202,7 @@ class V11 extends Migration
$this->dbProject->createDocument($new->getCollection(), $new);
}
} catch (\Throwable $th) {
Console::error('Failed to update document: ' . $th->getMessage());
Console::error("Failed to migrate document ({$new->getId()}) from collection ({$new->getCollection()}): " . $th->getMessage());
continue;
}
}
@ -394,7 +394,13 @@ class V11 extends Migration
}, $document);
$document = new Document($document->getArrayCopy());
$document = $this->migratePermissions($document);
$this->dbProject->createDocument('collection_' . $collection, $document);
try {
$this->dbProject->createDocument('collection_' . $collection, $document);
} catch (\Throwable $th) {
Console::error("Failed to migrate document ({$document->getId()}): " . $th->getMessage());
continue;
}
}
$offset += $this->limit;
}