Skip to content

Database Migration

A database migration is a version-controlled way to modify your database schema over time, allowing teams to create, modify, and share database structures.

Why It Matters

Migrations enable collaborative database development, track changes like code, and safely roll back problematic schema changes.

When to Use This

  • Creating new tables for features
  • Adding indexes for performance
  • Modifying existing columns safely
  • Sharing database changes across team members

Examples

  • Migration creating users table with id, name, email, password
  • Migration adding index on email for faster lookups
  • Migration renaming column with safe rollback capability

Related Terms