Sequelize Migrations
And a similar task migration file.
Sequelize migrations. Create a migration file with name like xxxxxxxxxxxxxx create user js in migrations folder. Treat migrations like a commit or a log for some change in database. With migrations you can transfer your existing database into another state and vice versa. This is on purpose so that sequelize can run the older migration files first and then the newer ones that build on top of them.
Sequelize will only use model files it s the table representation. Let s take a look at the migration file. On the other hand the migration file is a change in that model or more specifically that table used by cli. Sequelize will only use model files it s the table representation.
The sequelize cli is pretty great at generating model and migration files but not at adding associations with other models. Sequelize 2 0 0 introduces a new cli which is based on gulp and combines sequelize cli and gulp sequelize the cli ships support for migrations and project bootstrapping. Unfortunately there is not much clear documentation about adding. Create a migration file with name like xxxxxxxxxxxxxx create user js in migrations folder.
Treat migrations like a commit or a log for some change in database. Those state transitions are saved in migration files which describe the way how to get to the new state and how to revert the changes. On the other hand the migration file is a change in that model or more specifically that table used by cli. Sequelize will only use model files it s the table representation.
If you look carefully at the name of the file it will have the timestamp of when the migration file was created.