mirror of https://gitee.com/answerdev/answer.git
fix(migrations): add migration error log
This commit is contained in:
parent
bb5daf8003
commit
432bf21c98
|
@ -69,7 +69,7 @@ var migrations = []Migration{
|
|||
NewMigration("v1.0.9", "add login limitations", addLoginLimitations, true),
|
||||
NewMigration("v1.1.0-beta.1", "update user pin hide features", updateRolePinAndHideFeatures, true),
|
||||
NewMigration("v1.1.0-beta.2", "update question post time", updateQuestionPostTime, true),
|
||||
NewMigration("v1.1.0", "add gravatar base url", updateCount, false),
|
||||
NewMigration("v1.1.0", "add gravatar base url", updateCount, true),
|
||||
}
|
||||
|
||||
// GetCurrentDBVersion returns the current db version
|
||||
|
|
|
@ -14,14 +14,21 @@ import (
|
|||
)
|
||||
|
||||
func updateCount(x *xorm.Engine) error {
|
||||
addPrivilegeForInviteSomeoneToAnswer(x)
|
||||
addGravatarBaseURL(x)
|
||||
updateQuestionCount(x)
|
||||
updateTagCount(x)
|
||||
updateUserQuestionCount(x)
|
||||
updateUserAnswerCount(x)
|
||||
inviteAnswer(x)
|
||||
inBoxData(x)
|
||||
fns := []func(*xorm.Engine) error{
|
||||
addPrivilegeForInviteSomeoneToAnswer,
|
||||
addGravatarBaseURL,
|
||||
updateQuestionCount,
|
||||
updateTagCount,
|
||||
updateUserQuestionCount,
|
||||
updateUserAnswerCount,
|
||||
inviteAnswer,
|
||||
inBoxData,
|
||||
}
|
||||
for _, fn := range fns {
|
||||
if err := fn(x); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue