percolatestudio / meteor-migrations

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

Provide context object as argument to `up` and `down` #34

Closed JamesMGreene closed 9 years ago

JamesMGreene commented 9 years ago

I would like to see a context object (probably the whole migration object, honestly) provided as an argument to the invocation of up and down.

This can be beneficial for several reasons:

zol commented 9 years ago

Hey @JamesMGreene , thanks for your suggestion. In the interest of keeping this package as light as possible I'm going to refrain from making this change as it's reasonably trivial to work around it.

JamesMGreene commented 9 years ago

Just so we're on the same page, the change I'm proposing would just be:

Old
migration[direction].call();
New
migration[direction].call(null, migration);

OR:

migration[direction].call(migration, migration);

Not exactly heavy. :wink:

zol commented 9 years ago

Yeah ok, on second thoughts that's reasonable. I'd accept a PR, I think we can leave the parameter undocumented though.

JamesMGreene commented 9 years ago

@zol: PR #35 submitted.