Skip to content

Commit 81358f7

Browse files
jxsNeuralModderYouser Nayme
authored
Prepare 0.9.1 (#423)
* prepare 0.9.1 * Support rusqlite 0.38.x (#410) Co-authored-by: Youser Nayme <7685106-NeuralModder@users.noreply.gitlab.com> * do not log warning on nested dirs when finding migrations (#421) --------- Co-authored-by: Youser Nayme <51252915+NeuralModder@users.noreply.github.com> Co-authored-by: Youser Nayme <7685106-NeuralModder@users.noreply.gitlab.com>
1 parent 572a1f5 commit 81358f7

4 files changed

Lines changed: 38 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [0.9.1] - 2026-04-15
8+
### Changed
9+
- Support `rusqlite` 0.38.x. [#410](https://github.com/rust-db/refinery/pull/410)
10+
### Fixed
11+
- Avoid warning logs for nested directories while scanning migrations. [#421](https://github.com/rust-db/refinery/pull/421)
12+
713
## [0.9.0] - 2025-01-06
814
### Added
915
- Support for TLS in postgres/tokio-postgres using native-tls. [#353](https://github.com/rust-db/refinery/pull/353)

examples/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ int8-versions = ["refinery/int8-versions"]
1515

1616
[dependencies]
1717
refinery = { path = "../refinery", features = ["rusqlite"] }
18-
rusqlite = "0.37"
18+
rusqlite = "0.38"
1919
barrel = { version = "0.7", features = ["sqlite3"] }
2020
log = "0.4"
2121
env_logger = "0.11"

refinery_core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ url = "2.0"
3131
walkdir = "2.3.1"
3232

3333
# allow multiple versions of the same dependency if API is similar
34-
rusqlite = { version = ">= 0.23, <= 0.37", optional = true }
34+
rusqlite = { version = ">= 0.23, <= 0.38", optional = true }
3535
postgres = { version = ">=0.17, <= 0.19", optional = true }
3636
native-tls = { version = "0.2", optional = true }
3737
postgres-native-tls = { version = "0.5", optional = true}

refinery_core/src/util.rs

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,12 @@ pub fn find_migration_files(
8787
.filter_map(Result::ok)
8888
.map(DirEntry::into_path)
8989
// filter by migration file regex
90-
.filter(
91-
move |entry| match entry.file_name().and_then(OsStr::to_str) {
90+
.filter(move |entry| {
91+
if entry.is_dir() {
92+
return false;
93+
}
94+
95+
match entry.file_name().and_then(OsStr::to_str) {
9296
Some(file_name) if re.is_match(file_name) => true,
9397
Some(file_name) => {
9498
log::warn!(
@@ -98,8 +102,8 @@ pub fn find_migration_files(
98102
false
99103
}
100104
None => false,
101-
},
102-
);
105+
}
106+
});
103107

104108
Ok(file_paths)
105109
}
@@ -193,6 +197,28 @@ mod tests {
193197
assert_eq!(sql2.canonicalize().unwrap(), mods[1]);
194198
}
195199

200+
#[test]
201+
fn finds_sql_migrations_in_nested_directories() {
202+
let tmp_dir = TempDir::new().unwrap();
203+
let migrations_dir = tmp_dir.path().join("migrations");
204+
let nested_dir = migrations_dir.join("foo");
205+
fs::create_dir(&migrations_dir).unwrap();
206+
fs::create_dir(&nested_dir).unwrap();
207+
208+
let sql1 = nested_dir.join("V1__first.sql");
209+
let sql2 = nested_dir.join("V2__second.sql");
210+
fs::File::create(&sql1).unwrap();
211+
fs::File::create(&sql2).unwrap();
212+
213+
let mut mods: Vec<PathBuf> = find_migration_files(migrations_dir, MigrationType::All)
214+
.unwrap()
215+
.collect();
216+
mods.sort();
217+
218+
assert_eq!(sql1.canonicalize().unwrap(), mods[0]);
219+
assert_eq!(sql2.canonicalize().unwrap(), mods[1]);
220+
}
221+
196222
#[test]
197223
fn finds_unversioned_migrations() {
198224
let tmp_dir = TempDir::new().unwrap();

0 commit comments

Comments
 (0)