Skip to content
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

Merged
merged 6 commits into from
Nov 15, 2017

Conversation

tanel
Copy link
Member

@tanel tanel commented Nov 10, 2017

No description provided.

@tanel tanel changed the title WA-419 Migration with the lower version has applied after higher migration WA-419 Migration with the lower version was applied after higher migration Nov 10, 2017
func maxVersion(alreadyMigrated map[int64]bool) int64 {
result := int64(0)
for version, isMigrated := range alreadyMigrated {
if isMigrated && version > result {
Copy link
Contributor

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.

}

func chooseMigrations(files []file.File, alreadyMigrated map[int64]bool, up bool, steps int) ([]file.File, error) {
maxAlreadyMigrated := maxVersion(alreadyMigrated)
Copy link
Contributor

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

@tanel
Copy link
Member Author

tanel commented Nov 14, 2017

fixed

@andreigornostajev andreigornostajev merged commit 9caad82 into master Nov 15, 2017
@andreigornostajev andreigornostajev deleted the bugfix/do-not-run-old-migrations branch November 15, 2017 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants