mirror of
https://github.com/go-gitea/gitea
synced 2024-08-18 13:20:51 +02:00
Add information for migrate failure (#16803)
Improve the reporting of errors when there is a migration failure
This commit is contained in:
parent
648464b504
commit
efaf109435
@ -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
|
// Reset the mapper between each migration - migrations are not supposed to depend on each other
|
||||||
x.SetMapper(names.GonicMapper{})
|
x.SetMapper(names.GonicMapper{})
|
||||||
if err = m.Migrate(x); err != nil {
|
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
|
currentVersion.Version = v + int64(i) + 1
|
||||||
if _, err = x.ID(1).Update(currentVersion); err != nil {
|
if _, err = x.ID(1).Update(currentVersion); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user