-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sort migration ids before writing to summary file #21
Sort migration ids before writing to summary file #21
Conversation
Hi @kshepard, Thanks for reporting this and submitting a pull request! However, there are a few things I would like to clarify:
Maybe I should try to make this explanation more visible somewhere. |
// need to sort the migration ids before writing them to | ||
// the Summary file, so they are read in and processed | ||
// in the correct order. | ||
val sortedIds = ids.sortWith(_.toInt < _.toInt) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The identifier sortedIds
is not used in anywhere but the next line. Maybe it's a good idea to chain it in the next line (like ids.sortWith(...).map(...)
)? What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that sounds good to me, I'll update the PR.
Hi @lastland, thanks for taking a look at the PR! |
6c74e91
to
6428778
Compare
@kshepard Yeah that makes good sense. Thanks again for the PR! |
No problem, thanks for building this project! |
There has been quite a few changes so I plan to publish a 0.2.2 release soon -- hopefully tomorrow. Would that be OK for you? |
Sounds wonderful, thank you! |
0.2.2 is released, though it may take a few hours before the release is synced to mvn repo center. |
…summary Sort migration ids before writing to summary file
I encountered a problem when performing the following steps:
mg init
followed by amg migrate
mg init
followed by amigrate
This commit ensures that the migrations in the summary file are properly ordered and fixes the above issue.