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

Backport of migration fixes (#2604) (#2677)

* Rewrite migrations to not depend on future code changes (#2604)

* 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

* Fix migration from Gogs

* Refactor code

* add error check

* Additiomal fixes for migrations

* Add back nil check

* replace deprecated .Id with .ID

Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>

* change string map to interface map

Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>
This commit is contained in:
David Schneiderbauer
2017-10-09 15:08:22 +02:00
committed by Lauris BH
parent d1cec5ecfa
commit 74399f333f
4 changed files with 20 additions and 23 deletions

View File

@@ -47,7 +47,7 @@ func removeCommitsUnitType(x *xorm.Engine) (err error) {
}
}
team.UnitTypes = ut
if _, err := x.Id(team.ID).Cols("unit_types").Update(team); err != nil {
if _, err := x.ID(team.ID).Cols("unit_types").Update(team); err != nil {
return err
}
}