RepoPilot

How does Drizzle handle schema migrations?

About drizzle-team/drizzle-orm · 2 messages · last activity 7/19/2026

Question

How does Drizzle handle schema migrations?

RepoPilot

Based on the repository data, Drizzle handles schema migrations through Drizzle Kit, a powerful CLI companion tool mentioned in the README [README.md:L29-L35].

Here's how migrations work in Drizzle:

Separated Migration Imports

Starting from version 0.14.0, Drizzle separated migrations functionality into dedicated imports. For example:

  • PostgreSQL: import { migrate } from 'drizzle-orm-pg/node/migrate'; [changelogs/drizzle-orm-pg/0.14.0.md:L3-L5]
  • SQLite: import { migrate } from 'drizzle-orm-sqlite/better-sqlite3/migrate'; [changelogs/drizzle-orm-sqlite/0.14.1.md:L3-L5]

Drizzle Kit's Migration Capabilities

According to the README, Drizzle Kit can:

  • Generate SQL migration files automatically
  • Apply schema changes directly to the database [README.md:L31-L32]

Schema Definition & Code Generation

The drizzle-kit export command translates your Drizzle schema into SQL DDL statements. For example, a TypeScript table definition gets converted to CREATE TABLE SQL [changelogs/drizzle-kit/0.30.1.md:L3-L35].

Configuration Support

Drizzle Kit supports configuration options like:

  • casing parameter: Automatically maps naming conventions (e.g., camelCase in code to snake_case in the database) [changelogs/drizzle-kit/0.25.0.md:L146-L180]
  • dialect specification: Supports PostgreSQL, MySQL, SQLite, and Gel dialects [changelogs/drizzle-kit/0.30.5.md:L3-L30]

FOLLOW_UPS:

  • What SQL features does Drizzle support?
  • How do you connect Drizzle to different databases?
  • What is Drizzle Studio used for?

Want to ask your own question?

Open chat for drizzle-team/drizzle-orm

Public 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.