fix tag count upgrade

This commit is contained in:
aichy126 2023-06-07 17:39:25 +08:00
parent 3ad1c40cea
commit 3378cbff69
1 changed files with 1 additions and 1 deletions

View File

@ -224,7 +224,7 @@ func updateTagCount(x *xorm.Engine) error {
}
} else {
tag.QuestionCount = 0
if _, err = x.Update(tag, &entity.Tag{ID: tag.ID}); err != nil {
if _, err = x.Cols("question_count").Update(tag, &entity.Tag{ID: tag.ID}); err != nil {
log.Errorf("update %+v tag failed: %s", tag.ID, err)
return fmt.Errorf("update tag failed: %w", err)
}