From 963f7cffd9bb2986a965b2065b15ed13668ee8f3 Mon Sep 17 00:00:00 2001 From: Frank Elsinga Date: Wed, 24 Jul 2024 02:26:48 +0200 Subject: [PATCH] printed a bit of docuemtnation if parameters are ignored/infered --- sqlx-cli/src/migrate.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sqlx-cli/src/migrate.rs b/sqlx-cli/src/migrate.rs index e00f6de651..01df299e32 100644 --- a/sqlx-cli/src/migrate.rs +++ b/sqlx-cli/src/migrate.rs @@ -113,6 +113,12 @@ pub async fn add( // Type of newly created migration will be the same as the first one // or reversible flag if this is the first migration let migration_type = MigrationType::infer(&migrator, reversible); + if reversible && !migration_type.is_reversible() { + println!("Ignoring the -r option as the first migration is non-reversible"); + } + if !reversible && migration_type.is_reversible() { + println!("Infering the -r option to be set as the first migration is reversible"); + } let ordering = MigrationOrdering::infer(sequential, timestamp, &migrator); let file_prefix = ordering.file_prefix();