summaryrefslogtreecommitdiffstats
path: root/models/models.go
diff options
context:
space:
mode:
authorLauris BH <lauris@nix.lv>2017-07-02 16:50:57 +0300
committerLunny Xiao <xiaolunwen@gmail.com>2017-07-02 21:50:57 +0800
commitf189ccd2d60231485f045ce70a523fe12e401912 (patch)
tree6aff9591c4b486a155e2a8d8dc8bfe9cc143ecbb /models/models.go
parentf99489d5c522663cfc14b9b65539966844f3ee6b (diff)
downloadgitea-f189ccd2d60231485f045ce70a523fe12e401912.tar.gz
gitea-f189ccd2d60231485f045ce70a523fe12e401912.zip
Fix git hooks update to receive required arguments. Fixes #2090 (#2095)
* Changed migration calling so that migrations can use models package
Diffstat (limited to 'models/models.go')
-rw-r--r--models/models.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/models/models.go b/models/models.go
index 6a8fbfe624..1688a63649 100644
--- a/models/models.go
+++ b/models/models.go
@@ -24,7 +24,6 @@ import (
// Needed for the MSSSQL driver
_ "github.com/denisenkom/go-mssqldb"
- "code.gitea.io/gitea/models/migrations"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
)
@@ -259,7 +258,7 @@ func SetEngine() (err error) {
}
// NewEngine initializes a new xorm.Engine
-func NewEngine() (err error) {
+func NewEngine(migrateFunc func(*xorm.Engine) error) (err error) {
if err = SetEngine(); err != nil {
return err
}
@@ -268,7 +267,7 @@ func NewEngine() (err error) {
return err
}
- if err = migrations.Migrate(x); err != nil {
+ if err = migrateFunc(x); err != nil {
return fmt.Errorf("migrate: %v", err)
}