Dev.to
7/22/2026

The original title is "Catch the dangerous Postgres migration at the CI step"
Original: Catch the dangerous Postgres migration at the CI step
Short summary
pg-migration-guard is a free, open-source tool that analyzes Postgres migration SQL files and flags operations that hold dangerous locks (e.g., CREATE INDEX without CONCURRENTLY, SET NOT NULL scanning under ACCESS EXCLUSIVE). It integrates as a GitHub Action to annotate PRs inline with safe rewrites. A paid version adds 33 rules, Liquibase support, and a Claude Code skill.
- •Free tool flags lock-taking DDL in Postgres migrations before they reach production
- •Integrates as a GitHub Action with inline diff annotations and safe rewrite suggestions
- •Uses libpg_query for accurate SQL parsing; paid tier adds 33 rules and Claude Code skill
Generated with AI, which can make mistakes.
Is this a good recommendation for you?



