skillfed

django-migration-linter

Detect backward incompatible migrations for your django project

django-migration-linter v6.0.0 1.4M downloads/30d#3,996 on PyPI615
Permissive license Apache-2.0 AGING released

What it is and what it does

Django-migration-linter is a static analysis tool that scans your Django project's migrations and flags operations that would break backward compatibility—such as adding NOT NULL columns without defaults, dropping tables, or renaming tables. It runs as a Django management command and can be integrated into CI/CD pipelines or hooked into the makemigrations workflow to catch incompatibilities before they're committed.

The tool works by analyzing each migration file against a catalog of known incompatible patterns. When run, it reports a summary showing which migrations are valid, erroneous, ignored, or have warnings. It can optionally delete newly generated migrations that fail linting, with user confirmation, to prevent incompatible changes from entering the codebase. Configuration is optional via a Django setting, and the linter supports Django 3.2 through 6.0 on Python 3.9+.

Use it for:

  • Catch breaking schema changes during development before they reach production or older deployed instances.
  • Integrate into CI pipelines to reject pull requests that introduce backward-incompatible migrations.
  • Automatically validate migrations during makemigrations to prompt developers to fix issues immediately.
  • Audit existing migration history to identify past incompatibilities that may have caused deployment problems.
  • Enforce migration best practices in teams by preventing common pitfalls like undefaulted NOT NULL columns.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Analyzes Django migrations to detect backward-incompatible operations that could break older codebases, running as a management command or integration point during migration generation.

Yes, if you maintain Django projects with rolling deployments or need to support multiple active versions. The low install friction, permissive license, and active support for modern Django versions make it a practical addition to development workflows. The aging maintenance status is not a blocker—the tool is stable and the last commit is recent—but verify that its incompatibility catalog covers your project's specific patterns.

Install

django-migration-linter on PyPI

pip

pip install django-migration-linter

uv

uv add django-migration-linter

poetry

poetry add django-migration-linter

Installing django-migration-linter

Before you install

Low friction install with three lightweight runtime dependencies (django, appdirs, toml). Last commit on 2026-01-04 and marked aging, but the project remains active and supports current Django versions through 6.0.

License in practice

Apache-2.0 permissive license allows use in commercial and private projects with minimal restrictions; you must include a copy of the license and note material changes.

Quickstart

pip install django-migration-linter

# Add to Django INSTALLED_APPS:
INSTALLED_APPS = [
    ...,
    "django_migration_linter",
]

# Run linter:
python manage.py lintmigrations

Requires Django 3.2 or later and Python 3.9 or later; must be added to INSTALLED_APPS to function.

Verify before relying

  • Whether the linter detects all common backward-incompatible patterns or only a subset of known operations.
  • Performance impact when linting large migration histories or complex projects.
  • How the linter handles custom migration operations or third-party migration tools.

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 3 — django, appdirs, toml
Maintenance aging — 222 days since the last release
Last repo commit
First released
Downloads 1,368,348/month — #3,996 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: django_migration_linter-6.0.0-py3-none-any.whl

Keywords: django, migration, lint, linter, database, backward, compatibility

Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentFramework :: DjangoFramework :: Django :: 3.2Framework :: Django :: 4.0Framework :: Django :: 4.1Framework :: Django :: 4.2Framework :: Django :: 5.0Framework :: Django :: 5.1Framework :: Django :: 5.2Framework :: Django :: 6.0Intended Audience :: DevelopersProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9

Tags

django migration compatibility checkerdetect breaking database migrationsdjango backward compatibility lintermigration incompatibility detectordjango schema change validatorprevent breaking migrations djangodatabase migration safety check
django-toolingmigration-validationci-integration

More Quality Assurance packages