fix: align sourceFileVersions parsing with maxEmbeddedVersion#2194
fix: align sourceFileVersions parsing with maxEmbeddedVersion#2194mesutoezdil wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
Aligns the CLI migration filename version parsing (sourceFileVersions) with the runtime embedded-migrations parsing (maxEmbeddedVersion) by accepting any .up.sql file whose filename begins with decimal digits, rather than requiring an underscore separator.
Changes:
- Updated
sourceFileVersionsto parse versions usingfmt.Sscanf(name, "%d", &v)to matchmaxEmbeddedVersionbehavior. - Broadens recognized migration filenames from
NNN_name.up.sqlto any.up.sqlfilename with a leading integer.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1ccb40d to
083df7e
Compare
fd959d0 to
79e171e
Compare
|
It would be good to align the approaches, but this is the wrong direction. If we go with this approach, something like So I think the right approach would be to call |
79e171e to
2297b7e
Compare
Signed-off-by: mesutoezdil <mesudozdil@gmail.com>
2297b7e to
106bbb0
Compare
sourceFileVersions used strings.SplitN and skipped files without underscore, but maxEmbeddedVersion in runner.go uses fmt.Sscanf on any leading integer. this patch makes both consistent.