Skip to content

Commit c74541e

Browse files
authored
fix: separate last version flag for reset command (#3724)
1 parent 0c3e9cf commit c74541e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

cmd/db.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,8 @@ var (
193193
},
194194
}
195195

196-
noSeed bool
196+
noSeed bool
197+
lastVersion uint
197198

198199
dbResetCmd = &cobra.Command{
199200
Use: "reset",
@@ -202,7 +203,7 @@ var (
202203
if noSeed {
203204
utils.Config.Db.Seed.Enabled = false
204205
}
205-
return reset.Run(cmd.Context(), migrationVersion, nLastVersion, flags.DbConfig, afero.NewOsFs())
206+
return reset.Run(cmd.Context(), migrationVersion, lastVersion, flags.DbConfig, afero.NewOsFs())
206207
},
207208
}
208209

@@ -326,7 +327,7 @@ func init() {
326327
resetFlags.BoolVar(&noSeed, "no-seed", false, "Skip running the seed script after reset.")
327328
dbResetCmd.MarkFlagsMutuallyExclusive("db-url", "linked", "local")
328329
resetFlags.StringVar(&migrationVersion, "version", "", "Reset up to the specified version.")
329-
resetFlags.UintVar(&nLastVersion, "last", 0, "Reset up to the last n migration versions.")
330+
resetFlags.UintVar(&lastVersion, "last", 0, "Reset up to the last n migration versions.")
330331
dbResetCmd.MarkFlagsMutuallyExclusive("version", "last")
331332
dbCmd.AddCommand(dbResetCmd)
332333
// Build lint command

0 commit comments

Comments
 (0)