mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Rename db Engines related functions (#17481)
* Rename db Engines related functions Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@@ -96,7 +96,7 @@ func runRecreateTable(ctx *cli.Context) error {
|
||||
setting.Cfg.Section("log").Key("XORM").SetValue(",")
|
||||
|
||||
setting.NewXORMLogService(!ctx.Bool("debug"))
|
||||
if err := db.SetEngine(); err != nil {
|
||||
if err := db.InitEngine(); err != nil {
|
||||
fmt.Println(err)
|
||||
fmt.Println("Check if you are using the right config file. You can use a --config directive to specify one.")
|
||||
return nil
|
||||
@@ -114,7 +114,7 @@ func runRecreateTable(ctx *cli.Context) error {
|
||||
}
|
||||
recreateTables := migrations.RecreateTables(beans...)
|
||||
|
||||
return db.NewEngine(context.Background(), func(x *xorm.Engine) error {
|
||||
return db.InitEngineWithMigration(context.Background(), func(x *xorm.Engine) error {
|
||||
if err := migrations.EnsureUpToDate(x); err != nil {
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user