You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@answer.apache.org by li...@apache.org on 2024/03/20 03:53:31 UTC
(incubator-answer) branch feat/1.3.0/review updated: feat(migration): update clarity description config
This is an automated email from the ASF dual-hosted git repository.
linkinstar pushed a commit to branch feat/1.3.0/review
in repository https://gitbox.apache.org/repos/asf/incubator-answer.git
The following commit(s) were added to refs/heads/feat/1.3.0/review by this push:
new f89e946d feat(migration): update clarity description config
f89e946d is described below
commit f89e946d1ddd0e7cdfbcfaaea2da294807538e72
Author: LinkinStars <li...@foxmail.com>
AuthorDate: Wed Mar 20 11:53:22 2024 +0800
feat(migration): update clarity description config
---
internal/migrations/v20.go | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/internal/migrations/v20.go b/internal/migrations/v20.go
index 84c9c045..a2349787 100644
--- a/internal/migrations/v20.go
+++ b/internal/migrations/v20.go
@@ -21,11 +21,18 @@ package migrations
import (
"context"
+ "fmt"
"github.com/apache/incubator-answer/internal/entity"
+ "github.com/segmentfault/pacman/log"
"xorm.io/xorm"
)
func addReview(ctx context.Context, x *xorm.Engine) error {
+ c := &entity.Config{Key: "reason.not_clarity", Value: `{"name":"needs details or clarity","description":"This question currently includes multiple questions in one. It should focus on one problem only."}`}
+ if _, err := x.Context(ctx).Update(c, &entity.Config{Key: "reason.not_clarity"}); err != nil {
+ log.Errorf("update %+v config failed: %s", c, err)
+ return fmt.Errorf("update config failed: %w", err)
+ }
return x.Context(ctx).Sync(new(entity.Review))
}