Skip to content

Commit

Permalink
[cli] migrate up should apply all pending migrations (#1010)
Browse files Browse the repository at this point in the history
  • Loading branch information
billy1624 authored Oct 26, 2022
1 parent f653406 commit cb76b8f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions sea-orm-cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,9 @@ pub enum MigrateSubcommands {
value_parser,
short,
long,
default_value = "1",
help = "Number of pending migrations to apply"
)]
num: u32,
num: Option<u32>,
},
#[clap(value_parser, about = "Rollback applied migrations")]
Down {
Expand Down
2 changes: 1 addition & 1 deletion sea-orm-cli/src/commands/migrate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub fn run_migrate_command(
Some(MigrateSubcommands::Refresh) => ("refresh", migration_dir, None, verbose),
Some(MigrateSubcommands::Reset) => ("reset", migration_dir, None, verbose),
Some(MigrateSubcommands::Status) => ("status", migration_dir, None, verbose),
Some(MigrateSubcommands::Up { num }) => ("up", migration_dir, Some(num), verbose),
Some(MigrateSubcommands::Up { num }) => ("up", migration_dir, num, verbose),
Some(MigrateSubcommands::Down { num }) => {
("down", migration_dir, Some(num), verbose)
}
Expand Down
2 changes: 1 addition & 1 deletion sea-orm-migration/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ where
Some(MigrateSubcommands::Refresh) => M::refresh(db).await?,
Some(MigrateSubcommands::Reset) => M::reset(db).await?,
Some(MigrateSubcommands::Status) => M::status(db).await?,
Some(MigrateSubcommands::Up { num }) => M::up(db, Some(num)).await?,
Some(MigrateSubcommands::Up { num }) => M::up(db, num).await?,
Some(MigrateSubcommands::Down { num }) => M::down(db, Some(num)).await?,
Some(MigrateSubcommands::Init) => run_migrate_init(MIGRATION_DIR)?,
Some(MigrateSubcommands::Generate {
Expand Down

0 comments on commit cb76b8f

Please sign in to comment.