From d5694815f3d30c72f1280260e0b6f820cd998a30 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Thu, 15 Apr 2021 09:56:45 +0200 Subject: [PATCH] fix: migration for 0.8.x --- app/tasks/migrate.php | 2 +- src/Appwrite/Migration/Migration.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/tasks/migrate.php b/app/tasks/migrate.php index f9e92b24b7..7377de7959 100644 --- a/app/tasks/migrate.php +++ b/app/tasks/migrate.php @@ -36,7 +36,7 @@ $cli $projects = [$console]; $count = 0; - $migration = new Version\V06($register->get('db')); //TODO: remove hardcoded version and move to dynamic migration + $migration = new Version\V07($register->get('db')); //TODO: remove hardcoded version and move to dynamic migration while ($sum > 0) { foreach ($projects as $project) { diff --git a/src/Appwrite/Migration/Migration.php b/src/Appwrite/Migration/Migration.php index 1dfbbb99d5..bcfaae4726 100644 --- a/src/Appwrite/Migration/Migration.php +++ b/src/Appwrite/Migration/Migration.php @@ -75,11 +75,10 @@ abstract class Migration ]); $sum = \count($all); - Runtime::setHookFlags(SWOOLE_HOOK_ALL); + Runtime::enableCoroutine(SWOOLE_HOOK_ALL); Console::log('Migrating: ' . $offset . ' / ' . $this->projectDB->getSum()); \Co\run(function () use ($all, $callback) { - Runtime::enableCoroutine(SWOOLE_HOOK_ALL); foreach ($all as $document) { go(function () use ($document, $callback) {