Django Migrations Inspector

Django Migrations Inspector is an open-source migration safety toolkit for Django teams.

It helps answer the questions that usually show up too late:

  1. What does this migration graph actually look like?
  2. Are there merge conflicts or multiple heads in the graph?
  3. Are pending migrations safe to deploy?
  4. Is rollback straightforward or dangerous?

The current implementation already provides:

  1. Typed migration graph loading.
  2. Graph checks focused on multiple heads, merge nodes, and dependency hotspots.
  3. Risk analysis that separates rollback blockers, irreversible history, destructive changes, and review-needed migrations.
  4. Rollback simulation with blockers, blast radius, cross-app impact, and reverse-step previews.
  5. Local-first output in text, JSON, Mermaid, and Graphviz DOT.
  6. A reusable Django management command that works in local development and CI.

Command mindset

Each command is meant to answer one concrete Django workflow question:

  1. migration_inspect: Is the graph clean enough to reason about?
  2. migration_inspect risk: Can I deploy the pending migrations safely?
  3. migration_inspect audit: Which historical migrations need human review?
  4. migration_inspect rollback APP TARGET: Can I reverse this change path safely?

Why this toolkit exists

Django migrations are powerful, but teams still discover many migration problems too late:

  1. During CI.
  2. During deploys.
  3. During rollback attempts.
  4. After production drift is already confusing the release process.

This toolkit shifts that feedback left.

Open-source-first promise

The project is designed to stay useful without any paid service:

  1. All core functionality runs locally or in CI.
  2. No hosted backend is required.
  3. No account or telemetry is required.
  4. Rules, schemas, and documentation live in the repository.

Documentation hosting

This docs site is set up to work with both:

  1. GitHub Pages through the .github/workflows/docs.yml workflow
  2. Read the Docs through the .readthedocs.yaml configuration

Next milestones

The next feature layers planned on top of the graph foundation are:

  1. Deeper risk rules and scoring.
  2. Lock and downtime heuristics.
  3. Environment snapshot export and drift comparison.
  4. Richer zero-downtime guidance and recovery workflows.