Home / Market / drizzle migration conflict

drizzle migration conflict

Diagnose, repair, and prevent Drizzle Kit migration conflicts involving generated SQL, snapshots, journals, merge queues, and team workflows.

skill★ 508380 dlgithubCC-BY-4.0 content; MIT code; upstream exceptions applyInstall in CosmosUpstream Source

Documentation & Preview

--- name: drizzle-migration-conflict description: "Diagnose, repair, and prevent Drizzle Kit migration conflicts involving generated SQL, snapshots, journals, merge queues, and team workflows." category: databases risk: critical source: community source_repo: chaunsin/agent-skills source_type: community date_added: "2026-06-29" author: chaunsin tags: [drizzle, migrations, database, ci, merge-conflicts] tools: [git, python, rg] license: "Apache-2.0" license_source: "https://github.com/chaunsin/agent-skills/blob/master/LICENSE"

---

Drizzle Migration Conflict

Use this skill to help a user diagnose, repair, and prevent Drizzle Kit migration conflicts in a multi-developer repository. Drizzle migrations encode both SQL and migration snapshots, so the safe answer depends on the current migration directory shape, the Drizzle Kit version, and the git state.

When to Use This Skill

Safety rules

connects to a live database unless the user explicitly requests it and the target is clear.

config, environment variables, or scripts. Inspect scripts/config first, and require an explicit non-production or disposable target before any DB-backed validation.

git checkout --theirs, git restore, or rm unless the user has confirmed the exact side and files to change.

the auditable migration history that teams need.

repair normally discards generated migrations and regenerates them from the merged schema.

identify the parent branch before suggesting checkout commands.

Required references

guidance, or one of the preserved external links.

Source references

The full list of official docs, Drizzle GitHub discussions, community scripts, and merge-queue references lives in references/sources.md with trust levels and caveats. Read that file whenever the answer depends on current Drizzle behavior. Re-verify the official docs and the most relevant discussion when the project's drizzle-kit major version changes, since migration internals (snapshot format, journal shape, drizzle-kit check semantics) have shifted between releases.

Mode selection

Classify the task first:

  1. Diagnose - The user has a conflict or failed drizzle-kit check and wants to understand it.
  2. Repair - The user explicitly asks to fix or regenerate migration files.
  3. CI hardening - The user wants to prevent future conflicts in PRs or merge queues.
  4. Explain - The user wants a conceptual answer or a team playbook.

When the mode is not explicit, choose Diagnose.

Each mode unlocks a specific set of actions. Do not cross these boundaries without an explicit upgrade:

inspection. Do not run drizzle-kit check, typechecks, tests, or any write command. Report findings and the proposed repair path, but do not execute it.

Safety rules and explicit confirmation of the exact files and side (ours/theirs) to change.

against the user's database to validate the workflow; validate the workflow syntax and logic only.

Repository discovery

Collect repo facts before giving commands:

git status --short
git rev-parse --show-toplevel
git rev-parse --abbrev-ref HEAD
git ls-files -u
rg --files -g 'drizzle.config.*' -g 'package.json' -g 'pnpm-lock.yaml' -g 'yarn.lock' -g 'package-lock.json'

Then inspect the relevant files:

or src/db/migrations/.

If this skill's helper script is available, run it in read-only mode:

python3 <skill-dir>/scripts/check_drizzle_migrations.py --root .

Resolve <skill-dir> to the installed skill directory before running. Check these locations in order and use the first that contains scripts/check_drizzle_migrations.py:

  1. The target repository's vendored copy: <repo-root>/skills/drizzle-migration-conflict.
  2. The Claude Code skills directory: ~/.claude/skills/drizzle-migration-conflict.
  3. Any other install location reported by the user's environment.

If none of these resolve, fall back to the manual git/rg inspection commands above and tell the user the helper script was not found. Use --config <file> and --migrations-dir <dir> when the project has multiple Drizzle configs or outputs. The script never connects to a database and never writes files; it only reads migration directories and reports structural issues.

Migration structure decision

Identify the structure before proposing a fix:

migration SQL files such as <out>/0003_name.sql.

snapshot.json.

Recommended repair principles

not one side's stale snapshot.

branch after updating from that branch.

snapshot files.

check` only after confirming its config/env cannot point at production; then project tests only after inspecting the scripts and any database targets.

write.

Output rules

include database URLs, passwords, tokens, or connection strings in the report. Reference them as <redacted> or describe only whether they point at a production-like target.

NO_CONFLICT_FOUND, SAFE_TO_REGENERATE, NEEDS_USER_CONFIRMATION, or BLOCKED_BY_AMBIGUITY.

Limitations

Test prompts

Use these prompts to validate the skill behavior: