How does Drizzle handle schema migrations?
How does Drizzle handle schema migrations?
About drizzle-team/drizzle-orm · 2 messages · last activity 7/12/2026
Drizzle handles schema migrations through Drizzle Kit, a separate CLI companion tool. Here's how it works:
Migration Management
According to the README, [README.md:L29-L35], Drizzle Kit provides "hassle-free migrations" with the ability to:
- Generate SQL migration files for you
- Apply schema changes directly to the database
Key Features
The repository data shows several important aspects of migration handling:
-
Separation of Concerns: Migrations are handled through a separate import. For example, in PostgreSQL [changelogs/drizzle-orm-pg/0.14.0.md:L1-L9]:
import { migrate } from 'drizzle-orm-pg/node/migrate';Similarly for SQLite [changelogs/drizzle-orm-sqlite/0.14.1.md:L1-L9]:
import { migrate } from 'drizzle-orm-sqlite/better-sqlite3/migrate'; -
Configuration: Migrations are configured through
drizzle.config.tsfiles, as shown in multiple changelog examples. -
Special Cases: For certain databases like Gel, Drizzle takes a different approach. According to [changelogs/drizzle-kit/0.30.5.md:L3-L30], "Drizzle won't support
generate,migrate, orpushfeatures" for Gel. Instead, you use the Gel CLI to manage schema and migrations, then use drizzle-kit to pull the schema into Drizzle format.
The design keeps Drizzle ORM lightweight while delegating migration management to Drizzle Kit.
FOLLOW_UPS:
- What databases does Drizzle Kit support for migrations?
- How do you configure schema generation with Drizzle Kit?
- What's the Gel dialect and its workflow?
Want to ask your own question?
Open chat for drizzle-team/drizzle-ormPublic Q&A. Generated by RepoPilot from the actual source of drizzle-team/drizzle-orm. AI answers can be incomplete or stale — verify before relying on them.