roninforge/roninforge-drizzle/drizzle-migrate-to-v1
Claude Code and agent skill by roninforge/roninforge-drizzle
- community
Checking that the SKILL.md file is still in the repository.
Migrate a Drizzle codebase from 0.x to 1.0-rc: bump pins, codemod the pgArray import path, codemod or remove the casing API on drizzle(), rewrite relations() as defineRelations(), move enableRLS() to pgTable.withRLS(), regenerate migrations and confirm.
Install
npx vskill@latest install roninforge/roninforge-drizzle/drizzle-migrate-to-v1SKILL.md
The same SKILL.md was published earlier as roninforge/roninforge-drizzle/drizzle-migrate-to-v1.
Migrate Drizzle 0.x to 1.0-rc
When to Use
When you are ready to move a project from drizzle-orm@0.45.x (current stable) to drizzle-orm@1.0.0-rc.x.
Status note: as of May 2026 v1.0 has been in RC for over a year. The API is stable across recent RCs but a final1.0.0tag has not shipped. Do this migration only on new projects or when you specifically need a v1-only feature (Effect v4 native support, RQB v2). For prod systems, stay on 0.45.x until v1 stable lands.
Instructions
Apply in order. Build and run tests after each step.
Step 1: Pin v1 RC
package.json should read approximately:
Commit. The build will be broken until step 4 is done.
Step 2: Codemod the pgArray import path
Verify nothing else was importing from pg-core/utils (it was only pgArray in v0):
Step 3: Remove the casing: config from drizzle()
In src/db/index.ts (or wherever you call drizzle()):
If you actually need snake_case mapping, switch to per-table builders. Pick one of:
Option A: rewrite each table to use `snakeCase.table(...)` (explicit, more code):
Option B: switch to explicit column-name overrides (more verbose per column but no new import):
Option A is shorter for tables with many columns. Option B is more explicit and survives if you later migrate off Drizzle.
Step 4: Rewrite relations() as defineRelations()
The v0 relations() API splits across multiple files. The v1 defineRelations is a single call.
The v1 defineRelations takes the schema object plus a callback that defines relations for each table in a single nested object. The exact callback shape has changed between RC versions, so do not copy a snippet from a blog post. Read the current shape from the official source before writing your own:
- Drizzle relations v1-to-v2 migration doc
- The
defineRelationsexport innode_modules/drizzle-orm/relations.d.tsafter you install the RC
Then wire the result into the drizzle() call. The exact key name and spread shape for defineRelations output also changed between RCs, so do not copy a wiring snippet from this doc. Open node_modules/drizzle-orm/index.d.ts after install and read the drizzle() constructor's options type for the RC you pinned.
v1 is RC. Both thedefineRelationscallback and thedrizzle()options shape have shifted across1.0.0-rc.xreleases. Pin a single RC version and treat the relations file plus thedrizzle()call as the two places to re-check on every RC bump.
Step 5: Move RLS from enableRLS() to pgTable.withRLS(...)
.enableRLS() is removed in v1.
Step 6: Regenerate migration snapshots
The internal snapshot format may have changed. Regenerate from the current schema:
Review the regenerated migration. If your DB is already at the target schema, no SQL diff should be produced. If a diff appears, investigate before applying.
Step 7: Verify
If tests pass and tsc is clean, the migration succeeded. Commit.
If tests fail with db.query.X.findMany errors, RQB v2 has subtle behavior differences from v1 - read the relations v1-to-v2 doc and adjust the call sites.
Optional: Effect v4 Schema integration
If you use Effect Schema for validation, v1 ships first-party Effect v4 support and replaces the old drizzle-effect package. The exact export name and signature have shifted across RCs - check the changelog for the RC you pinned and read the export list from node_modules/drizzle-orm/effect/ before writing call sites.
Rollback plan
If anything breaks badly:
You're back on 0.45.x. The schema files and queries are unchanged at the SQL level - only the TypeScript surface changes between v0 and v1.
What NOT to do
- Do not mix v0 and v1 in the same project. The two RQB shapes are incompatible.
- Do not delete
drizzle/meta/without backing it up first. - Do not run
drizzle-kit pushto "fix" a generation diff - inspect the diff and either accept or revert at the schema level. - Do not migrate prod traffic until you have run integration tests against a v1-pinned copy of staging for at least a week.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/drizzle-migrate-to-v1/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/roninforge/roninforge-drizzle/drizzle-migrate-to-v1)