Drizzle migration conflict resolution

From wordbricks/onequery · View interactive version

Drizzle migration conflict resolution is an AI agent skill from the GitHub repository wordbricks/onequery. Resolve Drizzle migration merge/rebase conflicts in OneQuery by rewinding local-only migration history and regenerating migration metadata. Use when conflicts involve packages/db/src/migrations/meta/_journal.json, migration SQL files in packages/db/src/migrations/*.sql, or migration snapshots in pac

How to use this skill

Skill file

DB Migration Conflict Resolution

Goal

Resolve Drizzle migration conflicts without manually editing migration SQL or meta/_journal.json.

Workflow

  1. Inspect conflict scope.
  1. Fetch the base branch.
  1. Keep incoming journal history as baseline.
  1. Find local-only migration artifacts.
comm -23 <(git ls-tree -r --name-only HEAD packages/db/src/migrations | sort) \
  <(git ls-tree -r --name-only origin/main packages/db/src/migrations | sort)
  1. Remove local-only migration artifacts.
  1. Regenerate migration chain from schema.
  1. Stage and verify.
rg -n "^(<<<<<<<|=======|>>>>>>>)" packages/db/src/migrations/meta/_journal.json
  1. Finalize merge/rebase.

Guardrails

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.