feat: upgrade xorm
This commit is contained in:
parent
878d19beb8
commit
b1fd13bbcb
3 changed files with 5 additions and 5 deletions
1
go.mod
1
go.mod
|
@ -73,7 +73,6 @@ require (
|
||||||
src.techknowlogick.com/xgo v1.5.1-0.20220906164532-735bfdfb90d9
|
src.techknowlogick.com/xgo v1.5.1-0.20220906164532-735bfdfb90d9
|
||||||
src.techknowlogick.com/xormigrate v1.4.0
|
src.techknowlogick.com/xormigrate v1.4.0
|
||||||
xorm.io/builder v0.3.9
|
xorm.io/builder v0.3.9
|
||||||
xorm.io/core v0.7.3
|
|
||||||
xorm.io/xorm v1.1.2
|
xorm.io/xorm v1.1.2
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -27,9 +27,9 @@ import (
|
||||||
"code.vikunja.io/api/pkg/config"
|
"code.vikunja.io/api/pkg/config"
|
||||||
"code.vikunja.io/api/pkg/log"
|
"code.vikunja.io/api/pkg/log"
|
||||||
xrc "gitea.com/xorm/xorm-redis-cache"
|
xrc "gitea.com/xorm/xorm-redis-cache"
|
||||||
"xorm.io/core"
|
|
||||||
"xorm.io/xorm"
|
"xorm.io/xorm"
|
||||||
"xorm.io/xorm/caches"
|
"xorm.io/xorm/caches"
|
||||||
|
"xorm.io/xorm/names"
|
||||||
"xorm.io/xorm/schemas"
|
"xorm.io/xorm/schemas"
|
||||||
|
|
||||||
_ "github.com/go-sql-driver/mysql" // Because.
|
_ "github.com/go-sql-driver/mysql" // Because.
|
||||||
|
@ -80,7 +80,7 @@ func CreateDBEngine() (engine *xorm.Engine, err error) {
|
||||||
log.Fatalf("Error parsing time zone: %s", err)
|
log.Fatalf("Error parsing time zone: %s", err)
|
||||||
}
|
}
|
||||||
engine.SetTZDatabase(loc)
|
engine.SetTZDatabase(loc)
|
||||||
engine.SetMapper(core.GonicMapper{})
|
engine.SetMapper(names.GonicMapper{})
|
||||||
logger := log.NewXormLogger("")
|
logger := log.NewXormLogger("")
|
||||||
engine.SetLogger(logger)
|
engine.SetLogger(logger)
|
||||||
|
|
||||||
|
|
|
@ -23,9 +23,10 @@ import (
|
||||||
|
|
||||||
"code.vikunja.io/api/pkg/config"
|
"code.vikunja.io/api/pkg/config"
|
||||||
"code.vikunja.io/api/pkg/log"
|
"code.vikunja.io/api/pkg/log"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"xorm.io/core"
|
|
||||||
"xorm.io/xorm"
|
"xorm.io/xorm"
|
||||||
|
"xorm.io/xorm/names"
|
||||||
)
|
)
|
||||||
|
|
||||||
// CreateTestEngine creates an instance of the db engine which lives in memory
|
// CreateTestEngine creates an instance of the db engine which lives in memory
|
||||||
|
@ -48,7 +49,7 @@ func CreateTestEngine() (engine *xorm.Engine, err error) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
engine.SetMapper(core.GonicMapper{})
|
engine.SetMapper(names.GonicMapper{})
|
||||||
logger := log.NewXormLogger("DEBUG")
|
logger := log.NewXormLogger("DEBUG")
|
||||||
logger.ShowSQL(os.Getenv("UNIT_TESTS_VERBOSE") == "1")
|
logger.ShowSQL(os.Getenv("UNIT_TESTS_VERBOSE") == "1")
|
||||||
engine.SetLogger(logger)
|
engine.SetLogger(logger)
|
||||||
|
|
Loading…
Reference in a new issue