1
1
mirror of https://github.com/go-gitea/gitea synced 2025-08-13 04:58:19 +00:00

v38 migration used an outdated version of RepoUnit model (#2602)

* change repoUnit model in migration

* fix v16 migration repo_unit table

* fix lint error

* move type definition inside function

Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>
This commit is contained in:
David Schneiderbauer
2017-09-25 18:53:55 +02:00
committed by Lauris BH
parent 03ff7687e0
commit 4c9bf91a2c
2 changed files with 32 additions and 18 deletions

View File

@@ -5,12 +5,26 @@
package migrations
import (
"time"
"code.gitea.io/gitea/models"
"github.com/go-xorm/core"
"github.com/go-xorm/xorm"
)
func removeCommitsUnitType(x *xorm.Engine) (err error) {
// RepoUnit describes all units of a repository
type RepoUnit struct {
ID int64
RepoID int64 `xorm:"INDEX(s)"`
Type int `xorm:"INDEX(s)"`
Index int
Config core.Conversion `xorm:"TEXT"`
CreatedUnix int64 `xorm:"INDEX CREATED"`
Created time.Time `xorm:"-"`
}
// Update team unit types
const batchSize = 100
for start := 0; ; start += batchSize {