From 9552ece678fee4bac705e58bb2df9450243e8a57 Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Sun, 13 Jun 2021 01:12:13 +0300 Subject: [PATCH] chore: fix cli --- migra_cli/Cargo.toml | 2 +- migra_cli/src/commands/list.rs | 3 +-- migra_cli/src/commands/upgrade.rs | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/migra_cli/Cargo.toml b/migra_cli/Cargo.toml index 5c0dfbe..ce9302b 100644 --- a/migra_cli/Cargo.toml +++ b/migra_cli/Cargo.toml @@ -20,7 +20,7 @@ sqlite = ["migra/sqlite"] mysql = ["migra/mysql"] [dependencies] -migra = { version = "0", path = "../migra" } +migra = { version = "1", path = "../migra" } cfg-if = "1.0" structopt = "0.3" serde = { version = "1.0", features = ["derive"] } diff --git a/migra_cli/src/commands/list.rs b/migra_cli/src/commands/list.rs index 11bfdcd..a11ae7f 100644 --- a/migra_cli/src/commands/list.rs +++ b/migra_cli/src/commands/list.rs @@ -35,8 +35,7 @@ pub(crate) fn print_migration_lists(app: &App) -> migra::StdResult<()> { println!(); let all_migrations = migra::fs::get_all_migrations(&config.migration_dir_path())?; - let pending_migrations = - migra::fs::filter_pending_migrations(&all_migrations, &applied_migrations); + let pending_migrations = all_migrations.exclude(&applied_migrations); show_pending_migrations(&pending_migrations); diff --git a/migra_cli/src/commands/upgrade.rs b/migra_cli/src/commands/upgrade.rs index 82edc9b..73cb6a6 100644 --- a/migra_cli/src/commands/upgrade.rs +++ b/migra_cli/src/commands/upgrade.rs @@ -16,8 +16,7 @@ pub(crate) fn upgrade_pending_migrations( let applied_migration_names = client.get_applied_migrations()?; let all_migrations = migra::fs::get_all_migrations(&migrations_dir_path)?; - let pending_migrations = - migra::fs::filter_pending_migrations(&all_migrations, &applied_migration_names); + let pending_migrations = all_migrations.exclude(&applied_migration_names); if pending_migrations.is_empty() { println!("Up to date"); return Ok(());