Skip to content

Commit

Permalink
Fix default limit migrations amount in upgrade command
Browse files Browse the repository at this point in the history
  • Loading branch information
raoptimus committed Jan 23, 2024
1 parent 1458f88 commit 6249c8b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/action/redo.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func NewRedo(
}

func (r *Redo) Run(ctx *cli.Context) error {
limit, err := args.ParseStepStringOrDefault(ctx.Args().Get(0), 1)
limit, err := args.ParseStepStringOrDefault(ctx.Args().Get(0), minLimit)
if err != nil {
return err
}
Expand Down
6 changes: 5 additions & 1 deletion internal/action/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ import (
"github.com/urfave/cli/v2"
)

const (
defaultUpgradeLimit = 0
)

type Upgrade struct {
console Console
service MigrationService
Expand All @@ -37,7 +41,7 @@ func NewUpgrade(
}

func (u *Upgrade) Run(ctx *cli.Context) error {
limit, err := args.ParseStepStringOrDefault(ctx.Args().Get(0), minLimit)
limit, err := args.ParseStepStringOrDefault(ctx.Args().Get(0), defaultUpgradeLimit)
if err != nil {
return err
}
Expand Down

0 comments on commit 6249c8b

Please sign in to comment.