Skip to content

Commit

Permalink
warn when migration file name is malformed
Browse files Browse the repository at this point in the history
  • Loading branch information
lgmys committed Sep 24, 2020
1 parent f6b90af commit 274fafc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion refinery_core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "refinery-core"
version = "0.3.1"
version = "0.3.2"
authors = ["Katharina Fey <[email protected]>", "João Oliveira <[email protected]>"]
description = "This crate should not be used directly, it is internaly related to Refinery"
license = "MIT OR Apache-2.0"
Expand Down
13 changes: 12 additions & 1 deletion refinery_core/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,18 @@ pub fn find_migration_files(
// filter by migration file regex
.filter(
move |entry| match entry.file_name().and_then(OsStr::to_str) {
Some(file_name) => re.is_match(file_name),
Some(file_name) => {
if re.is_match(file_name) {
true
} else {
log::warn!(
"File \"{}\" does not adhere to the migration naming convention. See https://github.com/rust-db/refinery#usage for details.",
file_name
);

false
}
}
None => false,
},
);
Expand Down

0 comments on commit 274fafc

Please sign in to comment.