Browse Source

任务完成比例指标升级

tags/v1.21.12.1
ychao_1983 4 years ago
parent
commit
18d41933cd
1 changed files with 8 additions and 1 deletions
  1. +8
    -1
      models/custom_migrations.go

+ 8
- 1
models/custom_migrations.go View File

@@ -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
}

Loading…
Cancel
Save