Just like how we use Git to version control source code, we use migrations to manage the state of our database schemas.
Imagine you're working on project with another developer, and you're both tasked with creating a specific part of an event planning application. Let's say you are in charge of creating the Users
and your friend is going to create the Events
.
Let's say you and your friend divided the work in a way so that neither of you will have to to use each other's code to finish your tasks. While you're working on your part of the application, you only really need to touch the Users
table when you are working with the database.
Make sure that the project you are in is a node project (it has a package.json
) and you have already installed and initialized sequelize (npm install --save sequelize
, sequelize init
). Also make sure that your config.json
file has the correct credentials to connect to your database.