-
Notifications
You must be signed in to change notification settings - Fork 3
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
WA-419 Migration with the lower version was applied after higher migration #10
Conversation
migrator/migrator.go
Outdated
func maxVersion(alreadyMigrated map[int64]bool) int64 { | ||
result := int64(0) | ||
for version, isMigrated := range alreadyMigrated { | ||
if isMigrated && version > result { |
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.
What is this isMigrated
for (it is always true
)? Why we have map[int64]bool
type at all? I think we should use map[int64]struct{}
instead.
migrator/migrator.go
Outdated
} | ||
|
||
func chooseMigrations(files []file.File, alreadyMigrated map[int64]bool, up bool, steps int) ([]file.File, error) { | ||
maxAlreadyMigrated := maxVersion(alreadyMigrated) |
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.
suggest to rename to maxMigratedVersion
as it is first of all version
fixed |
No description provided.