Meteor / NodeJS 运行 迁移开始前自己的代码(Meteor 启动)

Meteor / NodeJS run own code before migration start (Meteor startup)

是否有可能在迁移之前在 Meteor/Node 应用程序中执行自己的代码运行?
我知道 Meteor.startup 但此代码 运行s 在数据库迁移 afaik 之后。

编辑:我使用的迁移包 idmontie:migrations@1.0.3

migration package you use doesn't seem to support that. If, however, you are able to switch to the more common percolate:migrations 然后您可以完全控制迁移何时发生,因为您实际上需要显式调用它,例如,

Meteor.startup(() => {
  /* the code you want to run first here.. */
  Migrations.migrateTo('latest');
});

过去,我什至做过这样的事情,我在 运行 迁移到某些版本之间的一些代码:

Meteor.startup(() => {
  /* some code to run before ... */
  Migrations.migrateTo(3);
  /* some code to run in between... */
  Migrations.migrateTo(5);
});