Skip to content

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

Add database prefix to the migration error

天舟6dd715840b11
diff --git a/db/mysql.go b/db/mysql.go
index 964594fbc7..ee497ebe15 100644
--- a/db/mysql.go
+++ b/db/mysql.go
@@ -229,7 +229,7 @@ func (driver *MySQLDriver) ExecuteMigration(ctx context.Context, m *MigrationInf
return err
}
if duplicate {
- return fmt.Errorf("%s has already applied version %s", m.Database, m.Version)
+ return fmt.Errorf("database '%s' has already applied version %s", m.Database, m.Version)
}
// Check if there is any higher version already been applied
@@ -238,7 +238,7 @@ func (driver *MySQLDriver) ExecuteMigration(ctx context.Context, m *MigrationInf
return err
}
if version != nil {
- return fmt.Errorf("%s has already applied version %s which is higher than %s", m.Database, *version, m.Version)
+ return fmt.Errorf("database '%s' has already applied version %s which is higher than %s", m.Database, *version, m.Version)
}
// If the migration type is not baseline, then we can only proceed if there is existing baseline