diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2021-08-25 01:46:55 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-24 18:46:55 +0100 |
commit | efaf109435172994763fa1799708628f0500ea6e (patch) | |
tree | 52c64db41394b10c6d8cbfe722595191b05b7db0 /models/migrations | |
parent | 648464b504755ee96187692fbe59acc2eec5bddf (diff) | |
download | gitea-efaf109435172994763fa1799708628f0500ea6e.tar.gz gitea-efaf109435172994763fa1799708628f0500ea6e.zip |
Add information for migrate failure (#16803)
Improve the reporting of errors when there is a migration failure
Diffstat (limited to 'models/migrations')
-rw-r--r-- | models/migrations/migrations.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/models/migrations/migrations.go b/models/migrations/migrations.go index 6c35d34c97..89a60445bb 100644 --- a/models/migrations/migrations.go +++ b/models/migrations/migrations.go @@ -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 { |