mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
fix(migration): adapt to review
This commit is contained in:
@@ -45,6 +45,8 @@ abstract class Migration
|
||||
*
|
||||
* @param Document $project
|
||||
* @param Database $projectDB
|
||||
*
|
||||
* @return Migration
|
||||
*/
|
||||
public function setProject(Document $project, Database $projectDB): Migration
|
||||
{
|
||||
@@ -59,12 +61,13 @@ abstract class Migration
|
||||
*
|
||||
* @param callable $callback
|
||||
*/
|
||||
public function forEachDocument(callable $callback)
|
||||
public function forEachDocument(callable $callback): void
|
||||
{
|
||||
$sum = 30;
|
||||
|
||||
$sum = $this->limit;
|
||||
$offset = 0;
|
||||
|
||||
while ($sum >= 30) {
|
||||
while ($sum >= $this->limit) {
|
||||
$all = $this->projectDB->getCollection([
|
||||
'limit' => $this->limit,
|
||||
'offset' => $offset,
|
||||
@@ -86,7 +89,6 @@ abstract class Migration
|
||||
try {
|
||||
$new = $this->projectDB->overwriteDocument($document->getArrayCopy());
|
||||
} catch (\Throwable $th) {
|
||||
var_dump($document);
|
||||
Console::error('Failed to update document: ' . $th->getMessage());
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user