diff --git a/system/Database/MigrationRunner.php b/system/Database/MigrationRunner.php index 241a9e6da5fa..6719cbec4549 100644 --- a/system/Database/MigrationRunner.php +++ b/system/Database/MigrationRunner.php @@ -839,7 +839,8 @@ protected function migrate($direction, $migration): bool throw new RuntimeException($message); } - $instance = new $class(); + /** @var Migration $instance */ + $instance = new $class(Database::forge($this->db)); $group = $instance->getDBGroup() ?? config(Database::class)->defaultGroup; if (ENVIRONMENT !== 'testing' && $group === 'tests' && $this->groupFilter !== 'tests') {