Skip to content

Commit

Permalink
add 'allow-downgrade' flag to ipfs repo migrate command
Browse files Browse the repository at this point in the history
  • Loading branch information
zaibon authored and christophedcpm committed Apr 6, 2021
1 parent 34d1d8c commit c51e6ac
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/commands/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ var repoMigrateCmd = &cmds.Command{
NoRemote: true,
Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error {
cctx := env.(*oldcmds.Context)
allowDowngrade, _ := req.Options[repoAllowDowngradeOptionName].(bool)

_, err := fsrepo.Open(cctx.ConfigRoot)
if err != fsrepo.ErrNeedMigration {
Expand All @@ -399,7 +400,7 @@ var repoMigrateCmd = &cmds.Command{

fmt.Println("Found outdated fs-repo, starting migration.")

err = migrate.RunMigration(fsrepo.RepoVersion)
err = migrate.RunMigration(fsrepo.RepoVersion, allowDowngrade)
if err != nil {
fmt.Println("The migrations of fs-repo failed:")
fmt.Printf(" %s\n", err)
Expand Down

0 comments on commit c51e6ac

Please sign in to comment.