跳到正文
Skillpedia
部署与云(DevOps)48k · #4496

drizzle-migration-conflict

它能做什么

这个工具可以帮你在团队中使用 Drizzle Kit 迁移时解决冲突。它会诊断问题,给出修复建议,并帮助你避免以后再次出现同样的问题。

适用场景

  • ✓当合并代码后,Drizzle 迁移文件发生冲突时。
  • ✓当 `drizzle-kit check` 命令报告迁移错误时。
  • ✓当你的团队需要一种安全的方式,在改动之后修复迁移时。

技能链接

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/drizzle-migration-conflict/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/drizzle-migration-conflict/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我合并代码后遇到了 Drizzle 迁移冲突,我该怎么办?”

每周 5 个新技能,1 分钟读完。

工作原理

这个工具会分析你的迁移文件和代码的当前状态,找出其中的差异,并给出解决冲突的步骤,确保迁移既安全又保持一致。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

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

  • Use when Drizzle migration files, _journal.json, or snapshot.json conflict after a pull, merge, rebase, or PR update.
  • Use when drizzle-kit check reports non-commutative migrations or migration folder conflicts.
  • Use when a team wants a safe repair flow for generated Drizzle migrations after schema changes converge.
  • Use when designing CI or merge-queue policy to prevent repeated Drizzle migration conflicts.

Safety rules

  • Start in read-only diagnosis mode unless the user explicitly asks to fix files.
  • Do not run drizzle-kit migrate, drizzle-kit push, database seed scripts, or any command that connects to a live database unless the user explicitly requests it and the target is clear.
  • Treat drizzle-kit check, project typechecks, and tests as command execution that may load project config, environment variables, or scripts. Inspect scripts/config first, and require an explicit non-production or disposable target before any DB-backed validation.
  • Do not delete migration files, rewrite _journal.json, or run git checkout --ours, git checkout --theirs, git restore, or rm unless the user has confirmed the exact side and files to change.
  • Do not recommend drizzle-kit push as the production solution for migration conflicts; it skips the auditable migration history that teams need.
  • Treat --ignore-conflicts as an exception for a known false positive, not as the normal fix.
  • Preserve schema source code changes unless the user explicitly asks to discard them. Conflict repair normally discards generated migrations and regenerates them from the merged schema.
  • If ours and theirs could mean different branches depending on merge direction, ask the user to identify the parent branch before suggesting checkout commands.

Required references

  • Read references/sources.md when the answer depends on current Drizzle behavior, official guidance, or one of the preserved external links.
  • Read references/conflict-resolution.md before recommending a repair flow.
  • Read references/ci-policy.md before proposing CI, merge queue, or team workflow changes.
  • Read references/report-template.md before writing a diagnostic report.

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:

  • Diagnose - read-only only. Run git status, git ls-files -u, the helper script, and file 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.
  • Repair - adds file writes and drizzle-kit generate/check execution, each gated by the Safety rules and explicit confirmation of the exact files and side (ours/theirs) to change.
  • CI hardening - adds proposing or editing CI/workflow files. Do not run migration commands against the user's database to validate the workflow; validate the workflow syntax and logic only.
  • Explain - conceptual only. No commands against the repo beyond optional read-only inspection.

Repository discovery

Collect repo facts before giving commands:

git status --short
git rev-parse --show-toplevel

…
常见问题

什么是 Drizzle 迁移?

迁移是一些记录数据库结构变更的文件。Drizzle Kit 可以帮你有条理地管理这些变更。

为什么会出现冲突?

当两个或更多人同时修改同一个迁移文件,而系统不知道该保留哪个版本时,就会产生冲突。

这个工具会改动我的数据库吗?

不会。这个工具只分析文件并给出修复建议。除非你明确提出要求,否则它不会执行任何会改变数据库的命令。

详情

作者的原始描述

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

repo: sickn33/agentic-awesome-skills

热度

GitHub 星标
48k
排名
#4496
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能