[cli] migrate up should apply all pending migrations (#1010)
This commit is contained in:
parent
f65340680a
commit
cb76b8f443
@ -97,10 +97,9 @@ pub enum MigrateSubcommands {
|
|||||||
value_parser,
|
value_parser,
|
||||||
short,
|
short,
|
||||||
long,
|
long,
|
||||||
default_value = "1",
|
|
||||||
help = "Number of pending migrations to apply"
|
help = "Number of pending migrations to apply"
|
||||||
)]
|
)]
|
||||||
num: u32,
|
num: Option<u32>,
|
||||||
},
|
},
|
||||||
#[clap(value_parser, about = "Rollback applied migrations")]
|
#[clap(value_parser, about = "Rollback applied migrations")]
|
||||||
Down {
|
Down {
|
||||||
|
@ -29,7 +29,7 @@ pub fn run_migrate_command(
|
|||||||
Some(MigrateSubcommands::Refresh) => ("refresh", migration_dir, None, verbose),
|
Some(MigrateSubcommands::Refresh) => ("refresh", migration_dir, None, verbose),
|
||||||
Some(MigrateSubcommands::Reset) => ("reset", migration_dir, None, verbose),
|
Some(MigrateSubcommands::Reset) => ("reset", migration_dir, None, verbose),
|
||||||
Some(MigrateSubcommands::Status) => ("status", 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 }) => {
|
Some(MigrateSubcommands::Down { num }) => {
|
||||||
("down", migration_dir, Some(num), verbose)
|
("down", migration_dir, Some(num), verbose)
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,7 @@ where
|
|||||||
Some(MigrateSubcommands::Refresh) => M::refresh(db).await?,
|
Some(MigrateSubcommands::Refresh) => M::refresh(db).await?,
|
||||||
Some(MigrateSubcommands::Reset) => M::reset(db).await?,
|
Some(MigrateSubcommands::Reset) => M::reset(db).await?,
|
||||||
Some(MigrateSubcommands::Status) => M::status(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::Down { num }) => M::down(db, Some(num)).await?,
|
||||||
Some(MigrateSubcommands::Init) => run_migrate_init(MIGRATION_DIR)?,
|
Some(MigrateSubcommands::Init) => run_migrate_init(MIGRATION_DIR)?,
|
||||||
Some(MigrateSubcommands::Generate {
|
Some(MigrateSubcommands::Generate {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user