sea-orm-cli migrate up can only apply 1 migration
sea-orm-cli version: 0.9.2
sea-orm-cli migrate up can only apply 1 pending migration, how does it apply all ?
I think the sea-orm-cli migrate up only applies 1 pending migration. The source code of the up command has a default value 1 for the num option:
#[clap(about = "Apply pending migrations")]
Up {
#[clap(
value_parser,
short,
long,
default_value = "1",
help = "Number of pending migrations to apply"
)]
num: u32,
},
#[clap(value_parser, about = "Rollback applied migrations")]
Down {
#[clap(
value_parser,
short,
long,
default_value = "1",
help = "Number of applied migrations to be rolled back"
)]
num: u32,
},
The documentation is wrong on this one. As it stands, I think there is no way to migrate all pending migrations using the cli.
Hey @ringrid @ctfdavis, the intended behaviour is that sea-orm-cli migrate up should apply all pending migration. While sea-orm-cli migrate up -n 1 only apply the first pending migration.
As a temporary workaround: execute sea-orm-cli migrate on your migration crate. It will apply all pending migration at once.