Fix missing output when UpdateManager is run within the Backend

This commit is contained in:
Ben Thomson 2020-01-19 23:15:02 +08:00
parent 078eb9191c
commit 56785bcd3c
No known key found for this signature in database
GPG Key ID: B2BAFACC5ED68F87
1 changed files with 10 additions and 6 deletions

View File

@ -348,9 +348,11 @@ class UpdateManager
* Rollback modules
*/
while (true) {
$rolledBack = $this->migrator
->setOutput($this->notesOutput)
->rollback($paths, ['pretend' => false]);
if (isset($this->notesOutput)) {
$this->migrator->setOutput($this->notesOutput);
}
$rolledBack = $this->migrator->rollback($paths, ['pretend' => false]);
if (count($rolledBack) == 0) {
break;
@ -405,9 +407,11 @@ class UpdateManager
{
$this->note($module);
$this->migrator
->setOutput($this->notesOutput)
->run(base_path() . '/modules/'.strtolower($module).'/database/migrations');
if (isset($this->notesOutput)) {
$this->migrator->setOutput($this->notesOutput);
}
$this->migrator->run(base_path() . '/modules/'.strtolower($module).'/database/migrations');
return $this;
}