drizzle-kit check

This guide assumes familiarity with:

drizzle-kit check command lets you check consistency of your generated SQL migrations history.

That’s extremely useful when you have multiple developers working on the project and altering database schema on different branches - read more about migrations for teams.




drizzle-kit check command requires you to specify dialect, you can provide it either via drizzle.config.ts config file or via CLI options

With config file
As CLI options
// drizzle.config.ts
import { defineConfig } from "drizzle-kit";

export default defineConfig({
  dialect: "sqlite",
});
npx drizzle-kit check

Multiple configuration files in one project

You can have multiple config files in the project, it’s very useful when you have multiple database stages or multiple databases on the same project:

npm
yarn
pnpm
bun
npx drizzle-kit check --config=drizzle-dev.config.ts
npx drizzle-kit check --config=drizzle-prod.config.ts
πŸ“¦ <project root>
 β”œ πŸ“‚ drizzle
 β”œ πŸ“‚ src
 β”œ πŸ“œ .env
 β”œ πŸ“œ drizzle-dev.config.ts
 β”œ πŸ“œ drizzle-prod.config.ts
 β”œ πŸ“œ package.json
 β”” πŸ“œ tsconfig.json

Ignore conflicts

In case you need check command to skip commutativity checks and bypass it, you can use --ignore-conflicts. If there is a situation you want to use it, then there is a big chance that drizzle-kit didn’t check migrations right and it’s a bug. Please report us your case, so we can fix it

drizzle-kit check --ignore-conflicts

Extended list of configurations

We recommend configuring drizzle-kit through drizzle.config.ts file, yet you can provide all configuration options through CLI if necessary, e.g. in CI/CD pipelines, etc.

dialectrequiredDatabase dialect you are using. Can be one of postgresql mysql sqlite turso singlestore mssql cockroach
outMigrations folder, default=./drizzle
configConfiguration file path, default=drizzle.config.ts

npm
yarn
pnpm
bun
npx drizzle-kit check --dialect=sqlite
npx drizzle-kit check --dialect=sqlite --out=./migrations-folder