Skip to main content

django-migration-checker

https://img.shields.io/pypi/v/django_migration_checker.svg https://img.shields.io/travis/tonyo/django-migration-checker.svg https://coveralls.io/repos/github/tonyo/django-migration-checker/badge.svg?branch=master

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.

Example:

>>> from django_migration_checker import get_conflicts
>>> get_conflicts(app_dir='./django-project/apps')
[('accounts', ['0001_initial', '0002_new_migration'])]
  • Free software: MIT license

Installation

pip install django-migration-checker

Why?

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:

  • Fast

    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.

  • No dependencies

    The package doesn’t require Django itself, NumPy, left-pad, or any other packages.

Command-line tool

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.

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

# Changelog

## [0.8.0] - 2023-01-05

## [0.7.1] - 2022-07-31

## [0.7.0] - 2021-12-26

## [0.6.0] - 2020-12-05

## [0.1.0] - 2016-09-09

  • First release on PyPI.

Metadata

Release files for django-migration-checker 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-migration-checker 0.8.0
File Size Uploaded
django-migration-checker-0.8.0.tar.gz 19.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-migration-checker 0.8.0
File Interpreter ABI Platform
django_migration_checker-0.8.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 25.4 kB

Release files / django-migration-checker-0.8.0.tar.gz

Download URL django-migration-checker-0.8.0.tar.gz
Size 19.3 kB
Tags Source
SHA-256 checksum
How to use checksums
4bcabbf5821e14cee65fcda47569f741a7148547517bf0ce75df2eaa035da62b
BLAKE2b-256 checksum
How to use checksums
a6993a16e330a0a2ab8dec2ea9eaa7a4aeeaa3154730297c8e3c76395422a1d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

Release files / django_migration_checker-0.8.0-py2.py3-none-any.whl

Download URL django_migration_checker-0.8.0-py2.py3-none-any.whl
Size 6.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
65d763d6d0dda30ed9429d3691a49289a3a0e82fd5146a5ecccf11f12de67290
BLAKE2b-256 checksum
How to use checksums
b529bd2e6712a230db1e3c65be19b4aa5eb36ac4cf3d337e0d6e5b525c286a58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.8.0 This release

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.3

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page