Generate & Run Migrations in Drizzle ORM

From the Drizzle ORM cheat sheet · Migrations · verified Jul 2026

Generate & Run Migrations

Generate SQL migration files from schema changes and apply them.

bash
# Generate migration from schema diff
npx drizzle-kit generate

# Apply pending migrations
npx drizzle-kit migrate

# Push schema directly (no migration files)
npx drizzle-kit push

# Open Drizzle Studio (DB GUI)
npx drizzle-kit studio
💡 generate creates SQL files in your out dir
⚡ push is great for prototyping — skips files
📌 migrate runs pending SQL migration files
🟢 studio opens a GUI at https://local.drizzle.studio
migrationsdrizzle-kitcli

More Drizzle ORM tasks

Back to the full Drizzle ORM cheat sheet