Skip to content

Commit

Permalink
Merge pull request #2524 from MGatner/migration-namespace
Browse files Browse the repository at this point in the history
Restore namespace after regress. Fixes #2474
  • Loading branch information
MGatner authored Jan 31, 2020
2 parents 6bdf787 + 1ca7672 commit d6ed858
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions system/Database/MigrationRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,9 @@ public function regress(int $targetBatch = 0, string $group = null)
throw new \RuntimeException($message);
}

// Save the namespace to restore it after loading migrations
$tmpNamespace = $this->namespace;

// Get all migrations
$this->namespace = null;
$allMigrations = $this->findMigrations();
Expand Down Expand Up @@ -366,6 +369,9 @@ public function regress(int $targetBatch = 0, string $group = null)
}
}

// Restore the namespace
$this->namespace = $tmpNamespace;

return true;
}

Expand Down

0 comments on commit d6ed858

Please sign in to comment.