I built a GitHub Action that catches migration collisions in PRs before they hit main #5522
saudademjj
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey everyone 👋
If you've worked on a team with Drizzle, you've probably hit this:
two developers branch off main, both run
drizzle-kit generate,and both create a migration with the same sequence number.
The second PR to merge silently breaks the migration history —
and you don't find out until deploy or
drizzle-kit checkfails locally.I built drizzle-migration-guard to catch this automatically in CI.
What it does
It runs
drizzle-kit checkon every PR that touches your schema,migrations, or config — and if there's a collision, it:
and a step-by-step fix recipe
migration collisions, not config typos or unrelated errors
(no wasted CI time)
Quick start (2 lines)
That's it. It auto-detects your drizzle.config.ts — zero extra config
for single-package repos.
A few features worth mentioning
for multi-package setups
against both old and new paths
workflow run, even without looking at the PR
Why not just run drizzle-kit check in a script?
You absolutely can. This action adds:
Links
Would love to hear feedback — especially from teams running Drizzle
in monorepos. If you've been bitten by migration collisions before,
give it a try and let me know how it goes!
Beta Was this translation helpful? Give feedback.
All reactions