aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/migrate.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/migrate.go')
-rw-r--r--cmd/migrate.go13
1 files changed, 5 insertions, 8 deletions
diff --git a/cmd/migrate.go b/cmd/migrate.go
index 459805a76d..e24dc9e572 100644
--- a/cmd/migrate.go
+++ b/cmd/migrate.go
@@ -7,11 +7,11 @@ import (
"context"
"code.gitea.io/gitea/models/db"
- "code.gitea.io/gitea/models/migrations"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
+ "code.gitea.io/gitea/services/versioned_migration"
- "github.com/urfave/cli/v2"
+ "github.com/urfave/cli/v3"
)
// CmdMigrate represents the available migrate sub-command.
@@ -22,11 +22,8 @@ var CmdMigrate = &cli.Command{
Action: runMigrate,
}
-func runMigrate(ctx *cli.Context) error {
- stdCtx, cancel := installSignals()
- defer cancel()
-
- if err := initDB(stdCtx); err != nil {
+func runMigrate(ctx context.Context, c *cli.Command) error {
+ if err := initDB(ctx); err != nil {
return err
}
@@ -36,7 +33,7 @@ func runMigrate(ctx *cli.Context) error {
log.Info("Log path: %s", setting.Log.RootPath)
log.Info("Configuration file: %s", setting.CustomConf)
- if err := db.InitEngineWithMigration(context.Background(), migrations.Migrate); err != nil {
+ if err := db.InitEngineWithMigration(context.Background(), versioned_migration.Migrate); err != nil {
log.Fatal("Failed to initialize ORM engine: %v", err)
return err
}