Is it possible to use migrations with model files to keep my model files a source of truth?

时间:2015-09-14 15:47:39

标签: sequelize.js database-management

The time has come when I must face the music and learn Sequalize's migration support.

While the migrations support looks elegant, my biggest fear is losing the models files source of truth. I want to use migrations, but I want to simultaneously keep my models files (I broke each table definition into its own file) up to date with the current prod state of the database, but my understanding of migrations is that once you start using them, they become the new source of truth for the database.

Is it possible to have a workflow where my models files remain a source of truth (like where sequelize can auto-create migrations files based on changes between them or where I can make both changes [creating migration and changing model file] simultaneously) or do I have I have to just accept migrations as the new source of truth about my database?

0 个答案:

没有答案