wordbricks/onequery · Archived

drizzle-migration-conflict-resolution

Resolve Drizzle migration merge/rebase conflicts in OneQuery by rewinding local-only migration history and regenerating migration metadata.

Installation

$ npx skills add wordbricks/onequery --skill drizzle-migration-conflict-resolution

Summary

  • 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 packages/db/src/migrations/meta/*_snapshot.json.

Stronger alternatives

This repository is archived — consider an actively maintained alternative.

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from wordbricks/onequery · top by installs.

npx skills add wordbricks/onequery

Browse all from wordbricks/onequery

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 17
License LICENSE
Default branch main
Open issues 0
Status Archived

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 2,610 B
  • docs SUMMARY.md 390 B

History

  1. First recorded snapshot · 0 installs

SKILL.md

DB Migration Conflict Resolution

Goal

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

Workflow

  1. Inspect conflict scope.
  • Run git status --short.
  • Confirm the migration conflict includes packages/db/src/migrations/meta/_journal.json.
  • If non-migration conflicts need product decisions, stop and ask the user.
  1. Fetch the base branch.
  • Run git fetch origin.
  • Default to origin/main unless the user requests another base branch.
  1. Keep incoming journal history as baseline.
  • Run git checkout --theirs packages/db/src/migrations/meta/_journal.json.
  • Do not hand-edit packages/db/src/migrations/meta/_journal.json.
  1. Find local-only migration artifacts.
  • Run:
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)
  • Treat returned SQL and snapshot files as local-only migration history.
  1. Remove local-only migration artifacts.
  • Run git rm <each-local-only-file> for returned migration SQL and snapshot files.
  • Keep incoming branch migration files intact.
  1. Regenerate migration chain from schema.
  • Run cd packages/db && bun run db:generate.
  • Let Drizzle regenerate the next migration and update meta/_journal.json.
  1. Stage and verify.
  • Run git add packages/db/src/migrations packages/db/src/migrations/meta/_journal.json.
  • Confirm no conflict markers remain:
rg -n "^(<<<<<<<|=======|>>>>>>>)" packages/db/src/migrations/meta/_journal.json
  • Inspect generated SQL and verify it reflects expected schema deltas only.
  1. Finalize merge/rebase.
  • Continue merge/rebase flow with git commit or git rebase --continue.
  • If pre-commit/pre-push hooks rewrite migration metadata formatting, commit the formatted files so the branch is clean.

Guardrails

  • Never manually create or edit files inside packages/db/src/migrations/.
  • Never manually edit packages/db/src/migrations/meta/_journal.json.
  • Regenerate via bun run db:generate after history rewind.
  • If generated migration includes unexpected schema changes, stop and ask the user before committing.