From 6e8cfb4ac54092d941fb033fd124f0df195fc67e Mon Sep 17 00:00:00 2001 From: LinkinStar Date: Fri, 25 Nov 2022 18:00:50 +0800 Subject: [PATCH] fix: update the initial reputation value --- internal/migrations/init.go | 48 +++++++++++++++++++++---------------- internal/migrations/v3.go | 2 +- 2 files changed, 29 insertions(+), 21 deletions(-) diff --git a/internal/migrations/init.go b/internal/migrations/init.go index 9c4bb522..d3a518d7 100644 --- a/internal/migrations/init.go +++ b/internal/migrations/init.go @@ -191,26 +191,26 @@ func initConfigTable(engine *xorm.Engine) error { {ID: 32, Key: "question.follow", Value: `0`}, {ID: 33, Key: "email.config", Value: `{"from_name":"","from_email":"","smtp_host":"","smtp_port":465,"smtp_password":"","smtp_username":"","smtp_authentication":true,"encryption":"","register_title":"[{{.SiteName}}] Confirm your new account","register_body":"Welcome to {{.SiteName}}

\n\nClick the following link to confirm and activate your new account:
\n{{.RegisterUrl}}

\n\nIf the above link is not clickable, try copying and pasting it into the address bar of your web browser.\n","pass_reset_title":"[{{.SiteName }}] Password reset","pass_reset_body":"Somebody asked to reset your password on [{{.SiteName}}].

\n\nIf it was not you, you can safely ignore this email.

\n\nClick the following link to choose a new password:
\n{{.PassResetUrl}}\n","change_title":"[{{.SiteName}}] Confirm your new email address","change_body":"Confirm your new email address for {{.SiteName}} by clicking on the following link:

\n\n{{.ChangeEmailUrl}}

\n\nIf you did not request this change, please ignore this email.\n","test_title":"[{{.SiteName}}] Test Email","test_body":"This is a test email."}`}, {ID: 35, Key: "tag.follow", Value: `0`}, - {ID: 36, Key: "rank.question.add", Value: `0`}, - {ID: 37, Key: "rank.question.edit", Value: `0`}, - {ID: 38, Key: "rank.question.delete", Value: `0`}, - {ID: 39, Key: "rank.question.vote_up", Value: `0`}, - {ID: 40, Key: "rank.question.vote_down", Value: `0`}, - {ID: 41, Key: "rank.answer.add", Value: `0`}, - {ID: 42, Key: "rank.answer.edit", Value: `0`}, - {ID: 43, Key: "rank.answer.delete", Value: `0`}, - {ID: 44, Key: "rank.answer.accept", Value: `0`}, - {ID: 45, Key: "rank.answer.vote_up", Value: `0`}, - {ID: 46, Key: "rank.answer.vote_down", Value: `0`}, - {ID: 47, Key: "rank.comment.add", Value: `0`}, - {ID: 48, Key: "rank.comment.edit", Value: `0`}, - {ID: 49, Key: "rank.comment.delete", Value: `0`}, - {ID: 50, Key: "rank.report.add", Value: `0`}, - {ID: 51, Key: "rank.tag.add", Value: `0`}, - {ID: 52, Key: "rank.tag.edit", Value: `0`}, - {ID: 53, Key: "rank.tag.delete", Value: `0`}, - {ID: 54, Key: "rank.tag.synonym", Value: `0`}, - {ID: 55, Key: "rank.link.url_limit", Value: `0`}, + {ID: 36, Key: "rank.question.add", Value: `1`}, + {ID: 37, Key: "rank.question.edit", Value: `200`}, + {ID: 38, Key: "rank.question.delete", Value: `-1`}, + {ID: 39, Key: "rank.question.vote_up", Value: `15`}, + {ID: 40, Key: "rank.question.vote_down", Value: `125`}, + {ID: 41, Key: "rank.answer.add", Value: `1`}, + {ID: 42, Key: "rank.answer.edit", Value: `200`}, + {ID: 43, Key: "rank.answer.delete", Value: `-1`}, + {ID: 44, Key: "rank.answer.accept", Value: `1`}, + {ID: 45, Key: "rank.answer.vote_up", Value: `15`}, + {ID: 46, Key: "rank.answer.vote_down", Value: `125`}, + {ID: 47, Key: "rank.comment.add", Value: `1`}, + {ID: 48, Key: "rank.comment.edit", Value: `-1`}, + {ID: 49, Key: "rank.comment.delete", Value: `-1`}, + {ID: 50, Key: "rank.report.add", Value: `1`}, + {ID: 51, Key: "rank.tag.add", Value: `1`}, + {ID: 52, Key: "rank.tag.edit", Value: `100`}, + {ID: 53, Key: "rank.tag.delete", Value: `-1`}, + {ID: 54, Key: "rank.tag.synonym", Value: `20000`}, + {ID: 55, Key: "rank.link.url_limit", Value: `10`}, {ID: 56, Key: "rank.vote.detail", Value: `0`}, {ID: 57, Key: "reason.spam", Value: `{"name":"spam","description":"This post is an advertisement, or vandalism. It is not useful or relevant to the current topic."}`}, {ID: 58, Key: "reason.rude_or_abusive", Value: `{"name":"rude or abusive","description":"A reasonable person would find this content inappropriate for respectful discourse."}`}, @@ -262,6 +262,14 @@ func initConfigTable(engine *xorm.Engine) error { {ID: 104, Key: "tag.rollback", Value: `0`}, {ID: 105, Key: "tag.deleted", Value: `0`}, {ID: 106, Key: "tag.undeleted", Value: `0`}, + {ID: 107, Key: "rank.comment.vote_up", Value: `1`}, + {ID: 108, Key: "rank.comment.vote_down", Value: `1`}, + {ID: 109, Key: "rank.question.edit_without_review", Value: `2000`}, + {ID: 110, Key: "rank.answer.edit_without_review", Value: `2000`}, + {ID: 111, Key: "rank.tag.edit_without_review", Value: `20000`}, + {ID: 112, Key: "rank.answer.audit", Value: `2000`}, + {ID: 113, Key: "rank.question.audit", Value: `2000`}, + {ID: 114, Key: "rank.tag.audit", Value: `20000`}, } _, err := engine.Insert(defaultConfigTable) return err diff --git a/internal/migrations/v3.go b/internal/migrations/v3.go index 0f955e8d..11d613ef 100644 --- a/internal/migrations/v3.go +++ b/internal/migrations/v3.go @@ -29,7 +29,7 @@ func addActivityTimeline(x *xorm.Engine) error { {ID: 45, Key: "rank.answer.vote_up", Value: `15`}, {ID: 46, Key: "rank.answer.vote_down", Value: `125`}, {ID: 47, Key: "rank.comment.add", Value: `1`}, - {ID: 48, Key: "rank.comment.edit", Value: `1`}, + {ID: 48, Key: "rank.comment.edit", Value: `-1`}, {ID: 49, Key: "rank.comment.delete", Value: `-1`}, {ID: 50, Key: "rank.report.add", Value: `1`}, {ID: 51, Key: "rank.tag.add", Value: `1`},