From 7aa264c269f7bd54060ba6bf9954c61c239163cb Mon Sep 17 00:00:00 2001 From: "Sergey Indlin (mbp-linux)" Date: 2023年11月27日 16:07:15 +0300 Subject: [PATCH] Fix migration for files with no number befor _ --- sqlx-macros-core/src/migrate.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sqlx-macros-core/src/migrate.rs b/sqlx-macros-core/src/migrate.rs index 73766a2c39..c77a8bcad1 100644 --- a/sqlx-macros-core/src/migrate.rs +++ b/sqlx-macros-core/src/migrate.rs @@ -93,7 +93,13 @@ pub(crate) fn expand_migrator(path: &Path) -> crate::Result { continue; } - let version: i64 = parts[0].parse()?; + let version = match parts[0].parse::() { + Ok(v) => v, + Err(_) => { + // not of the format: _.sql; ignore + continue; + } + }; let migration_type = MigrationType::from_filename(parts[1]); // remove the `.sql` and replace `_` with ` `

AltStyle によって変換されたページ (->オリジナル) /