chore(db): introduce db.Session and db.EngineMigration interfaces (#37746)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: wxiaoguang <2114189+wxiaoguang@users.noreply.github.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Copilot
2026-05-18 03:56:39 +08:00
committed by GitHub
parent d9149d8a0a
commit 94e3482d1a
300 changed files with 745 additions and 864 deletions
+1 -2
View File
@@ -21,7 +21,6 @@ import (
"code.gitea.io/gitea/services/doctor"
"github.com/urfave/cli/v3"
"xorm.io/xorm"
)
func newDoctorCommand() *cli.Command {
@@ -132,7 +131,7 @@ func runRecreateTable(ctx context.Context, cmd *cli.Command) error {
}
recreateTables := migrate_base.RecreateTables(beans...)
return db.InitEngineWithMigration(context.Background(), func(ctx context.Context, x *xorm.Engine) error {
return db.InitEngineWithMigration(context.Background(), func(ctx context.Context, x db.EngineMigration) error {
if err := migrations.EnsureUpToDate(ctx, x); err != nil {
return err
}