Sequilize/Umzug: where to store a state of a database schema?

1.2k Views Asked by At

So, I want to write an application which use some data migration. Where should I store a current state of db?

For example: I have a production server and my development machine. I wrote an application and 3 migrations for it. When I deploy the application server also runs 3 migrations. Now I'm going to write the 4th migration. How does server recognize that it need to run only 4th migration and it already run previous 3 migrations?

1

There are 1 best solutions below

1
On BEST ANSWER

Ref https://github.com/sequelize/cli

sequelize init:migrations

will generate migration folder where you need to write migrations and

There are three types of storage that you can use: sequelize, json, and none.

  • sequelize : stores migrations and seeds in a table on the sequelize database
  • json : stores migrations and seeds on a json file
  • none : does not store any migration/seed