MigraDiff
Fork of djrobstep/migra. All original features. Modernized, maintained, enhanced. AI-powered analysis, rollback capability, risk assessment — without vendor lock-in.
Overview
MigraDiff performs automatic schema diffing and migration generation for PostgreSQL. It compares two database states — live databases, SQL files, or any combination — and produces the exact SQL needed to migrate from one to the other.
Beyond diffing, MigraDiff provides AI-powered migration analysis including --explain (what a migration will do), --rollback (generate undo SQL), --advise (risk assessment), and --generate (natural language to migration SQL). Additional capabilities include --explain-drift for detecting unmanaged schema changes and --document for auto-generating schema documentation.
Supports multi-schema databases, row-level security (RLS) diffing, JSON output for automation and CI/CD integration. Runs locally with full control. No vendor lock-in. No cloud dependency.
Why MigraDiff
Everything djrobstep/migra did — automatic diffing, migration generation, schema comparison — now actively maintained and production-ready.
3.12+ compatible. Fixed deprecated patterns. Type-annotated codebase. Clean, auditable, and ready for modern Python environments.
AI-powered --explain, --rollback, --advise, --generate (using Claude). --explain-drift for unmanaged schema changes. --document for auto-generating schema docs. JSON output for automation.
Multi-schema support, RLS diffing, compliance-ready documentation. Built for teams that need production-grade database tooling.
Open source with clear upgrade path from original migra. Active development. No abandonment risk. Backward compatible.
Enterprise-grade support included with Business License. SLA guarantees for critical production migrations. Vendor accountability.
What's New
| Feature | Original migra | MigraDiff |
|---|---|---|
| Core schema diffing | ✓ | ✓ |
| Python 3.12+ compatibility | — | ✓ |
| AI-assisted migration analysis | — | ✓ |
| Rollback capability & risk assessment | — | ✓ |
| Multi-schema support | — | ✓ |
| Row-level security (RLS) diffing | — | ✓ |
| JSON output & automation | — | ✓ |
| Auto-documentation (--document) | — | ✓ |
| Email support & licensing | — | ✓ |
| Active maintenance & updates | — | ✓ |
Use Cases
Automate schema migrations in deployment pipelines. Generate, validate, and apply migrations with confidence using risk assessment.
Production databases accumulate unmanaged schema changes. --explain-drift catches differences between intended and actual schema state.
Manage schema migrations across hundreds of database tenants with multi-schema support and consistent diffing.
Documented schema changes for HIPAA, PCI-DSS, SOC 2 audits. Auto-generated schema documentation for compliance evidence.
Getting Started
Install via pip. Latest stable release. Python 3.12+.
→ pypi.org/project/migradiffBrowse source code, report issues, contribute. MIT licensed.
→ github.com/postgresql-tools/migraFree MIT for individuals. Business License for companies with employees.
→ View pricing & licensing