Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

Drizzle ORM · Command

drizzle-kit check

Checks generated SQL migration history for consistency, including race conditions or collisions. It requires a dialect and supports configuration through drizzle.config.ts or CLI flags.

How it works

The command examines generated SQL migration history for consistency and detects conflicts or race conditions between migrations. It requires a database dialect, supplied in drizzle.config.ts or with --dialect; configuration can also be selected with --config.

Syntax

npx drizzle-kit check [--dialect=<dialect>] [--out=<migrations-folder>] [--config=<config-file>] [--ignore-conflicts]

Parameters

NameTypeDescription
--dialectstringDatabase dialect; supported values include postgresql, mysql, sqlite, turso, singlestore, mssql, and cockroach.
--outstringPath to the migrations folder; defaults to ./drizzle.
--configstringPath to the Drizzle configuration file; defaults to drizzle.config.ts.
--ignore-conflictsbooleanBypasses commutativity-conflict checks.

Returns

Reports whether the generated SQL migration history is consistent; the page does not specify a formal return value.

Key points

  • Use the command to validate the consistency of generated SQL migration history.
  • A database dialect is mandatory for the check.
  • Set the dialect in drizzle.config.ts or pass it through CLI options.
  • Without an override, migrations are read from ./drizzle.
  • The default configuration file is drizzle.config.ts.

Common mistakes

  • Use --ignore-conflicts only when you intentionally want to bypass commutativity-conflict checks.

Example: Check generated migrations

npx drizzle-kit check --dialect=postgresql --out=./drizzle

Checks the migration history for consistency using the PostgreSQL dialect and the default-style migrations directory.

When to use it

Migration validation

Before merging migration changes, detect conflicting or colliding generated migrations.

Environment-specific checks

Run the same check with environment-specific Drizzle configuration files.

Custom migration directory

Validate migrations stored outside the default ./drizzle directory.

Interview questions

QWhat does drizzle-kit check do, and what is required to run it?

It validates the consistency of generated SQL migration history and checks for race conditions or collisions among generated migrations. The command needs a dialect, configured in drizzle.config.ts or passed on the command line.

Follow-up: How would you run it against a nondefault migration directory? Pass both the dialect and the directory, for example npx drizzle-kit check --dialect=postgresql --out=./migrations-folder.

QHow do you provide the dialect and choose configuration?

The command accepts a dialect either through drizzle.config.ts or through the --dialect CLI option. Supported dialects include PostgreSQL, MySQL, SQLite, Turso, SingleStore, MSSQL, and CockroachDB.

Follow-up: How can separate environments use different settings? Supply the relevant file with --config, such as --config=drizzle-prod.config.ts.

QWhat are the important defaults and overrides?

The default migrations directory is ./drizzle, and the default configuration file is drizzle.config.ts. You can override the directory with --out and the configuration path with --config.

Follow-up: What if commutativity conflicts are expected? Run the command with --ignore-conflicts to bypass those checks.

  • drizzle-kit generate
  • drizzle-kit migrate
  • drizzle.config.ts
  • Drizzle Kit

Source: Drizzle Kit `check`. Checked 2026-10-16.