percolatestudio / meteor-migrations

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

Include callback param? #68

Open 0o-de-lally opened 7 years ago

0o-de-lally commented 7 years ago

I don't see anywhere in the docs a mention of callbacks. I see Migrations is synchronous, but a migration may have async operations. In that case one needs to use futures or such to have a return wait.

I would expect there to be an API like:

Migrations.migrateTo(1, function(err, res){ 
    console.log('hello')
    //run maintenance method
    //trigger external api call
    // etc. etc.
 });

Am I not seeing something in the docs or is this intentionally not implemented?

It would also be worth mentioning an example of async updates in the docs. For example, bulk updates will finish after the migration returns completed, unless using Futures or other.