From 1ca76723069bcc949de7514f0f6f80598539982d Mon Sep 17 00:00:00 2001 From: MGatner Date: Thu, 30 Jan 2020 15:41:52 -0500 Subject: [PATCH] Restore namespace after regress. Fixes #2474 --- system/Database/MigrationRunner.php | 6 ++++++ 1 file changed, 6 insertions(+) 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; }