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

Fix to fail gracefully if current version missing #31

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zeroasterisk
Copy link

Use Case:

Given developer has a branch with a new Migration version.
When the developer changes branch back to master/integration.
Then the Migration should not throw an Error, crashing Meteor.

  • Change _findIndexByVersion() to return false if not found.
  • Change test for index into _migrateTo(), start=graceful fail, end=error.
  • Add a new test to verify functionality.

Use Case:

Given developer has a branch with a new Migration version.
When the developer changes branch back to master/integration.
Then the Migration should not throw an Error, crashing Meteor.

Change _findIndexByVersion() to return false if not found.
Change test for index into _migrateTo(), start=graceful fail, end=error.
Add a new test to verify functionality.
@zol
Copy link
Member

zol commented Aug 13, 2015

@zeroasterisk Thanks for submitting this PR. I hear your use case but I'm not sure I'm comfortable with solving it like this. The reason being that I don't like the control record being inconsistent with the migrations that have been defined. This could point to a more serious issue that becomes effectively masked with just a warning. I realize this is a pain in development right now.

@brent-hoover
Copy link

Just a note that this is causing an issue with production deployments in the rare case where we need to rollback to the previous version. You get an error saying it can't find the migration (because it existing in the version you are rolling back from) and the app completely doesn't stop.

Since rolling back a production version is not that common of an occurrence it would be better if it didn't just cause the app to crash.

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.

3 participants