Become a Gold Sponsor

drizzle-kit up

This guide assumes familiarity with:

drizzle-kit up command lets you upgrade drizzle schema snapshots to a newer version. It’s required whenever we introduce breaking changes to the json snapshots of the schema and upgrade the internal version.




drizzle-kit up 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 up

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 up --dialect=postgresql
npx drizzle-kit up --dialect=postgresql --our=./migrations-folder