mirror of
https://github.com/launchbadge/sqlx
synced 2024-11-10 06:24:16 +00:00
fix(migrate): improve error message when parsing version from filename
supercedes #2906
This commit is contained in:
parent
b4f6596b06
commit
c32809af91
1 changed files with 4 additions and 1 deletions
|
@ -47,7 +47,10 @@ impl<'s> MigrationSource<'s> for &'s Path {
|
|||
continue;
|
||||
}
|
||||
|
||||
let version: i64 = parts[0].parse()?;
|
||||
let version: i64 = parts[0].parse()
|
||||
.map_err(|_e| {
|
||||
format!("error parsing migration filename {file_name:?}; expected integer version prefix (e.g. `01_foo.sql`)")
|
||||
})?;
|
||||
|
||||
let migration_type = MigrationType::from_filename(parts[1]);
|
||||
// remove the `.sql` and replace `_` with ` `
|
||||
|
|
Loading…
Reference in a new issue