I'm building my first migration system ever with Umzug and Sequelize for a node app which uses sequelize and express on the backend.
My issue is that as the back end models change with commits over time (models being deleted, some changing, some being added) this breaks old migrations that happen to use the models from sequelize. Example:
Lets say I have a migration #1 that deals with "UserStats". Five releases later model UserStats needs to be removed from the app, so the model is deleted and a new migration is made to drop the table.
Now attempting to startup a new dev environment breaks because when the new server tries to run through all the old migrations it tries to find the model UserStats for the first migration, but the model no longer exists.
So the root problem is that versions of models get out of sync with the app migration state. Each migration requires the sequelize models to look like they did when that migration was initially created. What is the best way to deal with this?
via Henry
No comments:
Post a Comment