Skip to content

Instantly share code, notes, and snippets.

Avatar

Souranil Sen sladebot

View GitHub Profile
@jsumners
jsumners / gist:e6b5d0a699f16ba980a3
Last active Sep 14, 2021 — forked from thgaskell/gist:5987fccbd8473b5ef78f
Introduction to Sequelize Migrations
View gist:e6b5d0a699f16ba980a3

What are Migrations

Just like how we use Git to version control source code, we use migrations to manage the state of our database schemas.

I'm not really sure what that means...

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.

Creating models and migrations