Tony Brix
Tony Brix

Reputation: 4241

How to check if sequelize model matches database table?

Is there a way to check if a Sequelize model matches the database table?

Upvotes: 1

Views: 957

Answers (1)

Tony Brix
Tony Brix

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

Related Questions