On a Heroku hosted application, I have a file called migrator.js:
if (Meteor.isServer) {
Meteor.startup(function(){
Migrations.migrateTo('latest');
});
}
Alongside it I keep a folder /migrations with files 1.js, 2.js etc, each containing migrations for a specific version.
I think down migrations are only intended for development use, since you can’t use “$ meteor shell” in production. To run down migrations, I run “Migrations.migrateTo()” the version I need from the meteor shell, and then I git checkout to the right commit. When I go forward in time again I don’t need to use the meteor shell, it’ll migrate to automatically.
In your migrations folder, you are having files like 1.js, 2.js etc. Can you give any example of the contents of those files?
I am trying to achieve the following:
Let’s say for an upgrade I need to run migrations for two different collections. How can we add those migrations in one file like 1.js?