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.

feat(migration): update clarity description config

LinkinStarsf89e946d1ddd
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))
}