From 18d41933cd9bf1a09e9c8c92f01f81156a052be0 Mon Sep 17 00:00:00 2001 From: ychao_1983 Date: Tue, 16 Nov 2021 10:26:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=AE=8C=E6=88=90=E6=AF=94?= =?UTF-8?q?=E4=BE=8B=E6=8C=87=E6=A0=87=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/custom_migrations.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/models/custom_migrations.go b/models/custom_migrations.go index ec0e5f75e..fe40fdf13 100644 --- a/models/custom_migrations.go +++ b/models/custom_migrations.go @@ -23,7 +23,8 @@ var customMigrations = []CustomMigration{ var customMigrationsStatic = []CustomMigrationStatic{ {"Alter user static table field type ", alterUserStaticTable}, - {"Delete zuzhi user history data ", deleteNotDisplayUser}, + {"Delete organization user history data ", deleteNotDisplayUser}, + {"update issue_fixed_rate to 1 if num_issues is 0 ", updateIssueFixedRate}, } func MigrateCustom(x *xorm.Engine) { @@ -83,3 +84,9 @@ func deleteNotDisplayUser(x *xorm.Engine, static *xorm.Engine) error { return nil } + +func updateIssueFixedRate(x *xorm.Engine, static *xorm.Engine) error { + updateSQL := "update repo_statistic set issue_fixed_rate=1.0 where num_issues=0" + _, err := static.Exec(updateSQL) + return err +}