Upgrading to Drizzle v1
npm
yarn
pnpm
bun
npm i drizzle-orm@rc
npm i -D drizzle-kit@rc
Step 1 - Run drizzle-kit up
v3 migration folder discussion: https://github.com/drizzle-team/drizzle-orm/discussions/2832
We’ve updated the migrations folder structure by:
- removing
journal.json - grouping SQL files and snapshots into separate migration folders
- removing the
drizzle-kit dropcommand
These changes eliminate potential Git conflicts with the journal file and simplify the process of dropping or fixing conflicted migrations
The drizzle-kit has been architecturally redesigned:
- Migrated from database snapshots to DDL snapshots
Commutativity checks were added:
- Detecting non-commutative migrations across branches
Commutativity discussion: https://github.com/drizzle-team/drizzle-orm/discussions/5005
To migrate from old structure to a new one you would need to run
npm
yarn
pnpm
bun
npx drizzle-kit up
Step 2 - Review breaking changes
You can find out the full list of breaking changes here and make sure to update your code accordingly
If you were using Relational Queries, you need to upgrade to v2: