diff --git a/system/Database/MigrationRunner.php b/system/Database/MigrationRunner.php index 3f9a1fbe71c4..cf993c2c08e3 100644 --- a/system/Database/MigrationRunner.php +++ b/system/Database/MigrationRunner.php @@ -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(); @@ -366,6 +369,9 @@ public function regress(int $targetBatch = 0, string $group = null) } } + // Restore the namespace + $this->namespace = $tmpNamespace; + return true; }