docs: add migration safety guide with pgfence#654
docs: add migration safety guide with pgfence#654flvmnt wants to merge 4 commits intodrizzle-team:mainfrom
Conversation
Add a new guide showing how to analyze Drizzle Kit generated SQL migrations with pgfence for lock mode detection, risk assessment, and safe rewrite recipes before deploying to production.
There was a problem hiding this comment.
Pull request overview
Adds a new Drizzle docs guide describing how to use pgfence to analyze generated SQL migrations for potentially dangerous locking patterns, and exposes the guide in the Guides navigation map.
Changes:
- Added a new MDX guide: “Analyze migration safety with pgfence”.
- Added the guide entry to
src/content/docs/guides/_map.json.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/content/docs/guides/migration-safety-with-pgfence.mdx |
New ecosystem guide explaining a generate → analyze → migrate workflow and CI integration using pgfence. |
src/content/docs/guides/_map.json |
Adds the new guide to the Guides navigation list. |
Comments suppressed due to low confidence (1)
src/content/docs/guides/migration-safety-with-pgfence.mdx:10
CodeTabsandCodeTabare imported but never used in this guide. If the docs build/lint checks for unused imports, this can fail CI or add noise. Please remove these imports or add the intended<CodeTabs>/<CodeTab>usage.
import CodeTabs from '@mdx/CodeTabs.astro';
import CodeTab from '@mdx/CodeTab.astro';
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Addressed feedback: removed unused CodeTabs/CodeTab imports, pinned pgfence version in all examples, removed hidden Unicode characters. |
|
Verified: scanned both files for hidden/bidi Unicode characters (U+200B-U+200F, U+202A-U+202E, U+2066-U+2069, U+FEFF, and all Unicode Cf-category characters) — none found. Previous commit d362d6d already cleaned them. All npx pgfence commands confirmed pinned to @0.2.1 with --yes. |
Summary
src/content/docs/guides/migration-safety-with-pgfence.mdx)_map.jsonpgfence (
@flvmnt/pgfenceon npm) is a Postgres migration safety CLI that analyzes SQL files for dangerous lock patterns. Sincedrizzle-kit generateproduces plain SQL migration files, pgfence can analyze them directly to report lock modes, risk levels, and safe rewrite recipes before migrations reach production.Guide covers
<Npm>componentWhy this fits in Drizzle docs
Drizzle Kit generates raw SQL migration files, which makes it a natural fit for static analysis tools. This guide helps Drizzle users catch dangerous DDL patterns (table-level locks, missing
CONCURRENTLY, unsafe constraint additions) before deploying, following the same pattern as other ecosystem integration guides.