Migration
ELI5 — The Vibe Check
A migration is a versioned script that modifies your database schema — adding a column, creating a table, changing a type. Migrations are like git commits for your database. You can run them in order or roll them back.
Real Talk
A database migration is a versioned, incremental change to a database schema managed through code. Migration tools (Flyway, Liquibase, Knex, Prisma, Rails, Django) track which migrations have been applied and allow controlled schema evolution across environments. Each migration has an up (apply) and optionally a down (rollback) function.
Show Me The Code
-- Migration: add phone_number column
ALTER TABLE users ADD COLUMN phone_number TEXT;
-- Rollback:
ALTER TABLE users DROP COLUMN phone_number;
When You'll Hear This
"Create a migration to add the phone_number column." / "Never edit a migration that has already been run in production — create a new one."
Related Terms
Backup
A database backup is a saved copy of your data at a specific point in time.
Database
A database is like a super-organized filing cabinet for your app's data.
Schema
A database schema is the blueprint of your database — which tables exist, what columns they have, what types they are, and how they relate to each other.
Seed
Seeding a database means filling it with initial or test data automatically.