Browse Source

Merge branch 'V20211115' of git.openi.org.cn:OpenI/aiforge into download-model-error

pull/840/head
lewis 3 years ago
parent
commit
dad9c16baf
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