mirror of
https://github.com/launchbadge/sqlx.git
synced 2026-03-23 10:38:57 +00:00
cli: add --target-version CLI flags for migrate run/revert (#2538)
* cli: add --target-version CLI flags for migrate run/revert * cli: fix broken test * cli: test harness for `sqlx migrate` along with --target-version tests * cli: Fail if version supplied to run/revert is too old/new After some discussion with my coworkers, we thought about the behavior a bit more: The behavior is now that for a run, if the provided version is too old, the CLI will return with failure rather than being a no-op. This gives feedback to the operator instead of being quiet. It is still valid to up/downgrade to the latest version, this will still be a no-op to allow for idempotency.
This commit is contained in:
@@ -50,7 +50,7 @@ pub async fn reset(
|
||||
|
||||
pub async fn setup(migration_source: &str, connect_opts: &ConnectOpts) -> anyhow::Result<()> {
|
||||
create(connect_opts).await?;
|
||||
migrate::run(migration_source, connect_opts, false, false).await
|
||||
migrate::run(migration_source, connect_opts, false, false, None).await
|
||||
}
|
||||
|
||||
fn ask_to_continue(connect_opts: &ConnectOpts) -> bool {
|
||||
|
||||
Reference in New Issue
Block a user