Become a Gold Sponsor

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 both dialect and database connection credentials, you can provide them 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: "postgresql",
});
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 migrate --config=drizzle-dev.config.ts
npx drizzle-kit migrate --config=drizzle-prod.config.ts
πŸ“¦ <project root>
 β”œ πŸ“‚ drizzle
 β”œ πŸ“‚ src
 β”œ πŸ“œ .env
 β”œ πŸ“œ drizzle-dev.config.ts
 β”œ πŸ“œ drizzle-prod.config.ts
 β”œ πŸ“œ package.json
 β”” πŸ“œ tsconfig.json

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 postgresql,mysql or sqlite
outmigrations folder, default=./drizzle
configconfig file path, default=drizzle.config.ts

npm
yarn
pnpm
bun
npx drizzle-kit check --dialect=postgresql
npx drizzle-kit check --dialect=postgresql --our=./migrations-folder