Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: skip get db connection for mongodb (#3995)

h3n4l6541c26acb5c
diff --git a/plugin/db/util/driverutil.go b/plugin/db/util/driverutil.go
index adc6f46c59..a7095fcf2b 100644
--- a/plugin/db/util/driverutil.go
+++ b/plugin/db/util/driverutil.go
@@ -197,7 +197,7 @@ func ExecuteMigration(ctx context.Context, executor MigrationExecutor, m *db.Mig
if doMigrate {
// Switch to the target database only if we're NOT creating this target database.
// We should not call GetDBConnection() if the instance is MongoDB because it doesn't support.
- if !m.CreateDatabase {
+ if !m.CreateDatabase && executor.GetType() != db.MongoDB {
if _, err := executor.GetDBConnection(ctx, m.Database); err != nil {
return -1, "", err
}