Reputation: 4241
Is there a way to check if a Sequelize model matches the database table?
Upvotes: 1
Views: 957
Reputation: 4241
I couldn't find anything that would do this so I created sequelizr which can create models for Sequelize and check that the models match the tables.
To do this I forked sequelize-auto and created a wrapper to be able to execute in a terminal.
You can run npx sequelizr check [args]
to check if your database table layouts have changed then you can run npx sequelizr download [args]
to update the models.
Upvotes: 2