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(init): add users init config
LinkinStarsf500da413c40
diff --git a/internal/migrations/init.go b/internal/migrations/init.goindex b32a18bc..3daf1929 100644--- a/internal/migrations/init.go+++ b/internal/migrations/init.go@@ -179,6 +179,25 @@ func initSiteInfo(engine *xorm.Engine, language, siteName, siteURL, contactEmailif err != nil {return err}++ usersData := map[string]any{+ "default_avatar": "gravatar",+ "allow_update_display_name": true,+ "allow_update_username": true,+ "allow_update_avatar": true,+ "allow_update_bio": true,+ "allow_update_website": true,+ "allow_update_location": true,+ }+ usersDataBytes, _ := json.Marshal(usersData)+ _, err = engine.InsertOne(&entity.SiteInfo{+ Type: "users",+ Content: string(usersDataBytes),+ Status: 1,+ })+ if err != nil {+ return err+ }return err}