Been using Drizzle Kit since early 2024, upgraded through several major versions, and it consistently handles the migration bullshit better than anything else. Here's why it actually works.
The Migration Generation That Doesn't Break
Most migration tools either generate garbage SQL or require you to write everything by hand. Drizzle Kit reads your TypeScript schema files, compares them to your actual database, and generates the SQL diff automatically. When it can't figure out if you renamed a column or deleted one, it asks instead of guessing wrong and destroying your data.
## This actually works without mysterious failures
npx drizzle-kit generate
npx drizzle-kit migrate
The generated migrations are readable SQL that you can edit if needed. Try doing that with Prisma without breaking the entire migration system.
Two Migration Workflows That Make Sense
Development Flow (push): Skip migration files entirely for rapid iteration
## Perfect for development - applies schema changes directly
npx drizzle-kit push
Production Flow (generate + migrate): Create reviewable SQL migration files
## Generate migration file for review
npx drizzle-kit generate --name add_user_preferences
## Apply to database after review
npx drizzle-kit migrate
The push command handles schema drift by introspecting your current database and applying only the necessary changes. No migration history conflicts, no mysterious state issues. Works better than expected, especially after version 0.30.x where it kept corrupting enum migrations.
Database Introspection That Actually Helps
Need to start with an existing database? The pull command generates TypeScript schema files from your current database structure:
## Creates schema.ts from existing database
npx drizzle-kit pull
This is invaluable for migrating from other ORMs or working with legacy databases. TypeORM and Sequelize make this process painful - Drizzle Kit handles it in seconds.
Drizzle Studio - Database Browser That Doesn't Suck
The studio command spins up a web interface for browsing your database. Unlike phpMyAdmin or pgAdmin, it understands your Drizzle schema and relationships:
## Starts local database browser
npx drizzle-kit studio
Runs on localhost:4983
by default. You can edit records, explore relations, export data - all with proper type safety based on your schema definitions. Teams are using the embeddable version in their admin panels.
Configuration That Makes Sense
One config file handles everything. No separate migration configs, no environment-specific settings scattered everywhere:
// drizzle.config.ts
import { defineConfig } from \"drizzle-kit\";
export default defineConfig({
dialect: \"postgresql\", // or \"mysql\" or \"sqlite\"
schema: \"./src/schema.ts\",
out: \"./migrations\",
dbCredentials: {
url: process.env.DATABASE_URL!,
},
});
Multiple databases? Multiple config files:
npx drizzle-kit push --config=drizzle-dev.config.ts
npx drizzle-kit push --config=drizzle-prod.config.ts
Platform Support Without Gotchas
Works with every major database and hosting platform:
- Databases: PostgreSQL, MySQL, SQLite, plus the serverless variants you actually use
- Serverless: Neon, Turso, PlanetScale, Cloudflare D1
- Platforms: Vercel, Netlify, Railway, Fly.io, traditional servers
The driver configuration automatically detects your setup. For edge cases like AWS Data API or D1 HTTP, you specify the driver explicitly.
Error Handling That Tells You What's Wrong
Version 0.31.4 finally fixed the error messages. Instead of "migration failed" or some P2025 bullshit you have to Google, you get:
- The actual SQL statement that failed
- The specific schema differences causing conflicts
- Clear guidance on manual intervention steps
- Warnings about potential data loss before execution
CLI Commands That Cover Everything
Command | What It Does |
---|---|
generate |
Creates SQL migration files from schema changes |
migrate |
Applies generated migrations to database |
push |
Applies schema directly without migration files |
pull |
Generates schema from existing database |
studio |
Launches database browser interface |
check |
Validates migration consistency |
up |
Updates migration snapshots |
Each command has safety options:
--strict
: Prompts for approval before destructive operations--verbose
: Shows all SQL before execution--force
: Auto-approves data loss operations (use carefully)
When Drizzle Kit Works Best
Perfect for teams that want:
- Type-safe migrations generated from TypeScript schemas
- Readable SQL files that can be reviewed and modified
- Fast development iteration with push-based workflow
- Production safety with proper migration files
- Database introspection for existing projects
- Visual database browsing without separate tools
The Gotchas (Because There Are Always Some)
Schema renames can be tricky - Drizzle Kit will ask if you renamed a column or deleted it, but if you rename a table and add a column in the same migration, it gets confused and generates a DROP TABLE. Ask me how I know.
Connection pooling will bite you in serverless - learned this the hard way when migrations started timing out randomly on Vercel. The error messages actually help you debug them though.
For embedded databases (Expo SQLite, OP SQLite), migrations work differently since there's no central database to push to.
Production teams using Drizzle Kit consistently report fewer migration-related incidents than with other tools. The generated SQL is readable, the errors make sense, and when things break, you can actually fix them.
Had a migration fail on Black Friday deploy once - with Drizzle Kit, I could see exactly which ALTER TABLE statement died and why. Fixed it in 10 minutes instead of rolling back the entire release.
OK, personal war story aside - here's how it stacks up against the competition when your production deployment is on the line. Let's see how Drizzle Kit measures up against the alternatives that developers actually use.