drizzle-kit check
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
// drizzle.config.ts
import { defineConfig } from "drizzle-kit";
export default defineConfig({
dialect: "cockroach",
});npx drizzle-kit checkMultiple 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:
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.jsonIgnore 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-conflictsExtended 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.
dialect | required | Database dialect you are using. Can be one of postgresql mysql sqlite turso singlestore mssql cockroach |
out | Migrations folder, default=./drizzle | |
config | Configuration file path, default=drizzle.config.ts |
npx drizzle-kit check --dialect=cockroach
npx drizzle-kit check --dialect=cockroach --out=./migrations-folder