fix: make installing Forgejo work again (#7452)

- 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

# Testing

1. Install a Forgejo instance via the setup screen.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7452
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
This commit is contained in:
Gusted 2025-04-04 03:30:19 +00:00 committed by Earl Warren
parent afea42d517
commit 99fc04b763

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