Fix db engine (#32351)

Fix #32349
This commit is contained in:
wxiaoguang 2024-10-28 06:48:07 +08:00 committed by GitHub
parent d70af38447
commit a920fcfd91
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 172 additions and 74 deletions

View file

@ -25,7 +25,7 @@ func GetXORMEngine(engine ...*xorm.Engine) (x *xorm.Engine) {
if len(engine) == 1 {
return engine[0]
}
return db.DefaultContext.(*db.Context).Engine().(*xorm.Engine)
return db.GetEngine(db.DefaultContext).(*xorm.Engine)
}
// InitFixtures initialize test fixtures for a test database