fix: make installing Forgejo work again

- The default engine is no longer guaranteed to be of the type
`*xorm.Engine`, so instead return the interface `db.Engine`.
- Regression of forgejo/forgejo#7212
This commit is contained in:
Gusted 2025-04-03 18:13:34 +02:00
parent d28a64e538
commit 0be1fb749a
No known key found for this signature in database
GPG key ID: FD821B732837125F

View file

@ -6,12 +6,10 @@ package install
import (
"forgejo.org/models/db"
"forgejo.org/modules/setting"
"xorm.io/xorm"
)
func getXORMEngine() *xorm.Engine {
return db.DefaultContext.(*db.Context).Engine().(*xorm.Engine)
func getXORMEngine() db.Engine {
return db.DefaultContext.(*db.Context).Engine()
}
// CheckDatabaseConnection checks the database connection