Skip to content

Commit efaf109

Browse files
authored
Add information for migrate failure (#16803)
Improve the reporting of errors when there is a migration failure
1 parent 648464b commit efaf109

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

models/migrations/migrations.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ Please try upgrading to a lower version first (suggested v1.6.4), then upgrade t
429429
// Reset the mapper between each migration - migrations are not supposed to depend on each other
430430
x.SetMapper(names.GonicMapper{})
431431
if err = m.Migrate(x); err != nil {
432-
return fmt.Errorf("do migrate: %v", err)
432+
return fmt.Errorf("migration[%d]: %s failed: %v", v+int64(i), m.Description(), err)
433433
}
434434
currentVersion.Version = v + int64(i) + 1
435435
if _, err = x.ID(1).Update(currentVersion); err != nil {

0 commit comments

Comments
 (0)