Static migration conflict checker for Django
Note: this project is not actively maintained. It’s also kind of an ugly hack, and most probably there are better ways to solve the same problem these days.
The package allows to detect migration conflicts in Django application via static code analysis. In other words, it doesn’t run or import any of your code, but finds and parses Django migration files.
The package should work fine with Python 3.6+, and migrations generated by Django 1.7 and later.
>>> from django_migration_checker import get_conflicts >>> get_conflicts(app_dir='./django-project/apps') [('accounts', ['0001_initial', '0002_new_migration'])]
- Free software: MIT license
pip install django-migration-checker
The initial goal was to have some way to quickly analyze pull requests to a Django project and detect if the new changes introduce migration conflicts if they are merged to master.
Here are a few features:
No database connections, heavy modules loading, or checks are performed, so why would it be slow?
No up-to-date environment needed
You don’t need to have a working Django environment (valid settings.py file, all installed dependencies, etc.) to use this package. The only requirement is to have properly generated migration files.
The package doesn’t require Django itself, NumPy, left-pad, or any other packages.
After installing the package you can use the command-line script django-find-conflicts to detect migration conflicts from your console.
Here’s how it looks like:
$ django-find-conflicts ./django-project/apps [('accounts', ['0001_initial', '0002_new_migration'])] $ django-find-conflicts ./another-django-project/apps No conflicts detected.
## [0.7.0] - 2021-12-26
- Accept both single and double quotes ([#9](https://github.com/tonyo/django-migration-checker/pull/9))
- Drop support for Python 2.7 and 3.5
- Move to GitHub Actions
- Get rid of Travis
## [0.6.0] - 2020-12-05
- Exit with code 1 when conflicts are found ([#7](https://github.com/tonyo/django-migration-checker/pull/7))
## [0.1.0] - 2016-09-09
- First release on PyPI.
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Hashes for django-migration-checker-0.7.0.tar.gz
Hashes for django_migration_checker-0.7.0-py2.py3-none-any.whl