Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

wregis
Copy link

@wregis wregis commented Apr 20, 2020

Instead of returning a file not found error when no more changes are available, return a no change message.

Fixes #35
Fixes #312

Instead of returning a file not found error when no more changes are
available, return a no change message.

Fixes golang-migrate#35
Fixes golang-migrate#312
@wregis wregis force-pushed the fix/no-change-error branch from 1a1756d to ff3cad2 Compare April 20, 2020 14:43
@coveralls
Copy link

coveralls commented Apr 20, 2020

Pull Request Test Coverage Report for Build 757

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 53.17%

Totals Coverage Status
Change from base Build 751: 0.0%
Covered Lines: 2575
Relevant Lines: 4843

💛 - Coveralls

Copy link
Member

@dhui dhui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! However, I believe the current behavior is correct.

// reached end, and didn't apply any migrations
if limit > 0 && count == 0 {
ret <- os.ErrNotExist
ret <- ErrNoChange
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This error is returned when a limit has been specified. e.g. you know how many migrations you expect to be run. So os.ErrNotExist is the correct error to return in this case.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. However, I gave to say I've made this mistake because the documentation and examples was not clear enough to me, can I help on this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, feel free to update the docs! The FAQ might be a good place to start.

@wregis wregis closed this May 3, 2020
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.

file does not exist error
3 participants