Skip to content

Commit

Permalink
Add information for migrate failure (#16803)
Browse files Browse the repository at this point in the history
Improve the reporting of errors when there is a migration failure
  • Loading branch information
lunny authored Aug 24, 2021
1 parent 648464b commit efaf109
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion models/migrations/migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ Please try upgrading to a lower version first (suggested v1.6.4), then upgrade t
// Reset the mapper between each migration - migrations are not supposed to depend on each other
x.SetMapper(names.GonicMapper{})
if err = m.Migrate(x); err != nil {
return fmt.Errorf("do migrate: %v", err)
return fmt.Errorf("migration[%d]: %s failed: %v", v+int64(i), m.Description(), err)
}
currentVersion.Version = v + int64(i) + 1
if _, err = x.ID(1).Update(currentVersion); err != nil {
Expand Down

0 comments on commit efaf109

Please sign in to comment.