Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

fix tag count upgrade

aichy1263378cbff694a
diff --git a/internal/migrations/v13.go b/internal/migrations/v13.go
index 3576abb2..36b2df5e 100644
--- a/internal/migrations/v13.go
+++ b/internal/migrations/v13.go
@@ -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)
}