File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -141,6 +141,7 @@ func main() {
141141 target := flag .Int ("to" , CurrentVersion , "specify version to upgrade to" )
142142 yes := flag .Bool ("y" , false , "answer yes to all prompts" )
143143 version := flag .Bool ("v" , false , "print highest repo version and exit" )
144+ revertOk := flag .Bool ("revert-ok" , false , "allow running migrations backward" )
144145
145146 flag .Parse ()
146147
@@ -166,6 +167,11 @@ func main() {
166167 os .Exit (1 )
167168 }
168169
170+ if vnum > * target && ! * revertOk {
171+ fmt .Println ("ipfs migration: attempt to run backward migration\n To allow, run this command again with --revert-ok" )
172+ os .Exit (1 )
173+ }
174+
169175 if vnum == * target {
170176 fmt .Println ("ipfs migration: already at target version number" )
171177 return
You can’t perform that action at this time.
0 commit comments