feat: upgrade xorm

This commit is contained in:
kolaente 2022-06-30 16:14:30 +02:00
parent 878d19beb8
commit b1fd13bbcb
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B
3 changed files with 5 additions and 5 deletions

1
go.mod
View file

@ -73,7 +73,6 @@ require (
src.techknowlogick.com/xgo v1.5.1-0.20220906164532-735bfdfb90d9
src.techknowlogick.com/xormigrate v1.4.0
xorm.io/builder v0.3.9
xorm.io/core v0.7.3
xorm.io/xorm v1.1.2
)

View file

@ -27,9 +27,9 @@ import (
"code.vikunja.io/api/pkg/config"
"code.vikunja.io/api/pkg/log"
xrc "gitea.com/xorm/xorm-redis-cache"
"xorm.io/core"
"xorm.io/xorm"
"xorm.io/xorm/caches"
"xorm.io/xorm/names"
"xorm.io/xorm/schemas"
_ "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)
}
engine.SetTZDatabase(loc)
engine.SetMapper(core.GonicMapper{})
engine.SetMapper(names.GonicMapper{})
logger := log.NewXormLogger("")
engine.SetLogger(logger)

View file

@ -23,9 +23,10 @@ import (
"code.vikunja.io/api/pkg/config"
"code.vikunja.io/api/pkg/log"
"github.com/stretchr/testify/assert"
"xorm.io/core"
"xorm.io/xorm"
"xorm.io/xorm/names"
)
// 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.ShowSQL(os.Getenv("UNIT_TESTS_VERBOSE") == "1")
engine.SetLogger(logger)