NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #2161 most downloaded on PyPI
Detect backward incompatible migrations for your django project
Last release 9 months ago
04 Jan 2026
Release timing varies
gaps range from 1 weeks to 1.2 years
Nearly every release is documented
notes for 38 of 38 stable releases
Nothing withdrawn
no release was ever pulled
9 years old
38 releases · first in 2017
Breaking change : Handle custom Django app label when gathering migrations from git reference. ( #262 ) This means that, an app that was previously re…
Feature:
Bug:
DEFAULT NULL as no default value being defined (#302)Miscellaneous:
One column per quarter.
Allow ignoring all initial migrations, with --ignore-initial-migrations
Feature:
--ignore-initial-migrationsBug:
Miscellaneous:
Don't detect 'IS NOT NULL' as backward incompatible changes (issue #263 )
Feature:
db_default attribute (issue #275)sqlmigrate commands, with --ignore-sqlmigrate-errors option (issue #274)Bug:
Miscellaneous:
setup.py and setup.cfg to pyproject.tomlBreaking change : stop silently ignoring when the internal sqlmigrate call fails and the linter cannot analyse the migration. Instead, the linter cras…
Breaking change: stop silently ignoring when the internal sqlmigrate call fails and the linter cannot analyse the migration.
Instead, the linter crashes and lets the sqlmigrate error raise, in order to avoid letting a problematic migration pass.
One common reason for such an error is the SQL generation which requires the database to be actually migrated in order to fetch actual constraint names from it.
The crash is a sign to double-check the migration. But if you are certain the migration is safe, you can ignore it (issue #209)
Features:
RunPython model import check when using a through object like MyModel.many_to_many.through.objects.filter(...) (issue #218)IgnoreMigration operation as elidable=Truefunctools.partial functions in RunPython data migrationsCREATE_INDEX_EXCLUSIVE to detect index creation while an exclusive lock is heldBug:
Miscellaneous:
mypy and ruff usagesAllow configuring logging for makemigrations command and unify behaviour with lintmigrations (issue #207 )
makemigrations command and unify behaviour with lintmigrations (issue #207)--warnings-as-errors option to allow selecting some migration tests only (issue #201)sql_analyser option to makemigrations in order to specify the SQL analyser to use (issue #208)project_root_path and verbosity configurable from other setting source (issue #203)Drop support for Python 2.7, 3.5 and 3.6
Setting a field as NOT NULL without default passed the linter.
Fixed bug:
Breaking API change on lintmigrations command :
Breaking API change on lintmigrations command:
GIT_COMMIT_ID becomes an optional argument with the named parameter --git-commit-id [GIT_COMMIT_ID]lintmigrations command takes now two positional arguments: lintmigrations [app_label] [migration_name]New features:
Miscellaneous:
toml configuration files--verbosity 0 or -v 0 correctly to not print anything from the lintermaster branch to mainStop packaging the 'tests' module into the release wheel file
Remove toml support for config files
toml support for config filesRemove .editorconfig from default config file
.editorconfig from default config fileREVERSIBLE_DATA_MIGRATION -> RUNPYTHON_REVERSIBLE
Renamed lint checks:
REVERSIBLE_DATA_MIGRATION -> RUNPYTHON_REVERSIBLENAMING_CONVENTION_RUNPYTHON_ARGS -> RUNPYTHON_ARGS_NAMING_CONVENTIONDATA_MIGRATION_MODEL_IMPORT -> RUNPYTHON_MODEL_IMPORTDATA_MIGRATION_MODEL_VARIABLE_NAME -> RUNPYTHON_MODEL_VARIABLE_NAMEREVERSIBLE_RUNSQL_DATA_MIGRATION -> RUNSQL_REVERSIBLEFeatures/fixes:
django_migration_linter logger--include-name and --include-name-contains to only include migration with a certain nameRenamed lint checks:
REVERSIBLE_DATA_MIGRATION -> RUNPYTHON_REVERSIBLENAMING_CONVENTION_RUNPYTHON_ARGS -> RUNPYTHON_ARGS_NAMING_CONVENTIONDATA_MIGRATION_MODEL_IMPORT -> RUNPYTHON_MODEL_IMPORTDATA_MIGRATION_MODEL_VARIABLE_NAME -> RUNPYTHON_MODEL_VARIABLE_NAMEREVERSIBLE_RUNSQL_DATA_MIGRATION -> RUNSQL_REVERSIBLEFeatures/fixes:
django_migration_linter logger--include-name and --include-name-contains to only include migration with a certain nameOthers:
isort to the projectAdd possibility to lint newly generated migrations through the makemigrations command. You can activate it through the --lint command option, or by de
makemigrations command.
You can activate it through the --lint command option, or by default with the MIGRATION_LINTER_OVERRIDE_MAKEMIGRATIONS = True Django settings.Handle making a column NOT NULL with a Django default value as backward incompatible. This should have been the case from the beginning, but it was no…
django-add-default-value lib, the operation should still be compatible.--include-migrations-from option.
When the given filename is missplelled, fail instead of linting all migrations.
When the file is empty, lint no migrations instead of linting all migrations.tox, flake8, etc.)Don't pin dependencies but only define minimal versions
Correctly detect apps.get_models when on multiple lines in data migration
Fixed bug:
apps.get_models when on multiple lines in data migrationMake summary output more friendly (Thanks to @vald-phoenix)
IgnoreMigrationappdirs strictly to 1.4.3, but allow higher versionsDetect in data migrations if models are imported the correct way or not
Add linting on data migrations that will raise warnings
--quiet warning option to suppress warning messages--warnings-as-errors option to handle warnings as errorsRework documentation. Make README smaller and clearer. Move detailed documentation to docs/ folder.
README smaller and clearer. Move detailed documentation to docs/ folder.Update testing dependencies (mysqlclient, Django 2.2 and black)
Update testing dependencies (mysqlclient, Django 2.2 and black)
Add --include-migrations-from option to only consider migrations specified in a given file. No matter if the migrations are selected from a git commit
--include-migrations-from option to only consider migrations specified in a given file. No matter if the migrations are selected from a git commit or not, we only select the ones in the given file.--quiet {ok,ignore,error} option to remove different or multiple types of messages from being printed to stdout.Fixed bugs:
Add --exclude-migration-tests option to ignore backward incompatible migration tests.
--exclude-migration-tests option to ignore backward incompatible migration tests.NOT NULL constraint.DROP TABLE backward incompatible migration.UNIQUE constraint as backward incompatible migration.Internal change:
Add --unapplied-migrations and --applied-migrations mutually exclusive options in order to respectively lint only unapplied or applied migrations.
--unapplied-migrations and --applied-migrations mutually exclusive options
in order to respectively lint only unapplied or applied migrations.--project-root-path which allows to specify the root path
which is used for finding the .git folder. (thanks to @linuxmaniac)Improve speed of ignored migration through the IgnoreMigration operation. Instead of generating their SQL, we verify if the Operation class is present
IgnoreMigration operation.
Instead of generating their SQL, we verify if the Operation class is present.
Thus we don't have to wait for the SQL generation. Also improves the caching strategy.Breaks some internal APIs, so minor update to 1.1.0.
Breaking changes of the linter usage.
Breaking changes of the linter usage.
The linter now is a Django management command.
It should be used with a python manage.py lintmigrations followed by the usual options.
Additionally, the linter now needs to be added the to the INSTALLED_APPS in your Django settings.
Fixed bugs:
Bug fix: handle migration files with spaces in their name by quoting the migration name
Bug fix: handle migration files with spaces in their name by quoting the migration name
Explicitly test for mysql, sqlite3 and *postgresql*
Fixes migrations that are ignored to generate empty SQL, that PostgreSQL complains about. It throws an exception making migrations fail, that are in f
Fixes migrations that are ignored to generate empty SQL, that PostgreSQL complains about. It throws an exception making migrations fail, that are in fact valid. (Thanks to @fevral13 and @mes3yd )
Add options -V and --version to show the current linter version
Bug fix: handle when the linter is called in the working dir django-migration-linter .
django-migration-linter .Fix caching when app is in a folder and not at the root of the project
Fix caching when app is in a folder and not at the root of the project
Do not check for .git folder at root, because it might be located somewhere else. Let git itself do the job
Make some imports relative
The django migration linter is now set to a Beta version, instead of Alpha since it has been used for quite some time.
The django migration linter is now set to a Beta version, instead of Alpha since it has been used for quite some time.
Version 0.1.0 comes with:
IgnoreMigration() in the migrations operations list. See readmeOther things:
black format to improve Python-code readabilityMinor bug fix when no errors detected
Minor bug fix when no errors detected
* Use logger correctly * Drop django 1.10 support
Only consider added migrations during linting
Assure compatibility for multiple python and django versions.
Assure compatibility for multiple python and django versions.
Try to improve PyPi readme Better error messages
Made a mistake and accidentally deleted 0.0.2 from PyPi :-1:
Made a mistake and accidentally deleted 0.0.2 from PyPi :-1:
=> release 0.0.3
First version of command line tool to lint django migrations.
First version of command line tool to lint django migrations.
Your coding agent can read these notes before it upgrades. Set up the MCP server →