You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a recommended way of implementing migration? I use sequelizer, which is capable of generating migration scripts but is there a way to integrate is with moleculer?
The text was updated successfully, but these errors were encountered:
For sequelize migrations you have 2 options, running them programmatically or during CICD pipeline. To run them programmatically you should use umzug library.
We added a mixin called dbExtensions.js and inside we have a migrate() method with the following code:
and then you add the mixin to service that you want to migrate and the following code:
async afterConnected() {
await this.migrate();
},
Keep in mind that there are some inter-version issues so I am giving you the version of umzug that we currently use:
"umzug": "2.3.0",
This approach carries with it various potential problems, one of them being not able to do canary deployments or run multiple service versions at the same time. That is a whole other can of worms that you need to investigate. If you approach this carefully it will work fine in production environment (we have a daily, hourly backup PLUS before update backup).
For CICD migrations it depends of your pipeline and CICD strategy and thus is way out of scope of github comment.
Hi,
Is there a recommended way of implementing migration? I use sequelizer, which is capable of generating migration scripts but is there a way to integrate is with moleculer?
The text was updated successfully, but these errors were encountered: