percolatestudio / meteor-migrations

Simple migration system for Meteor
https://atmospherejs.com/percolate/migrations
MIT License
245 stars 58 forks source link

Save migration exception in the control record #55

Closed rodrigok closed 7 years ago

engelgabriel commented 8 years ago

That would be very helpful!

marceloschmidt commented 8 years ago

:+1:

geekgonecrazy commented 8 years ago

:+1: this is very needed

ggranito commented 8 years ago

This should also update the version number to reflect successful migrations that have occurred. But otherwise this will help.

rodrigok commented 8 years ago

@ggranito can you explain better?

kahmali commented 8 years ago

:+1: Thanks for this @rodrigok.

This would be extremely helpful. Is there something preventing it from being merged, or is it just awaiting review?

ggranito commented 8 years ago

If multiple migrations are running, like migrating from version 0 to version 2. If migration 1 succeeds, but migration 2 fails, there is currently no record that 1 was successful. So this error logging should set the version number in the control object to the failed version number - 1. (Because you don't want to re-run version 1 if it was successful)

rodrigok commented 8 years ago

@ggranito Seems that your issue is not related with this PR, I'm just adding the current error to the control record. I'm not modifying how this lib sets the correct version number after successful migrations.

scharf commented 8 years ago

Is there a reason for not merging this PR?

hexsprite commented 8 years ago

Seems pretty reasonable to me. How about adding a test?