Skip to main content

Detect backward incompatible migrations for your django project

Project description

Lint Django migrations

Install

pip install lint_django_migrations

How to use

  1. Install the app in settings.py
INSTALLED_APPS = [
    # ...
    "lint_django_migrations",
]
  1. Check your migrations
python manage.py lintmigrations

This will return an error if any of the migrations are backwards incompatible.

  1. Fix errors If there is an error, you have 2 options. Fix the migration or tell the linter that the migration is not backwards incompatible. If you feel the migration is ok, run the command again with the --interactive flag
python manage.py lintmigrations --interactive

Setup on existing code base

If you would like to setup the linter on the existing codebase, it can be tedious to mark every applied migration as valid. For that purpose, you can snapshot the current state and just run the linter on future migrations

python manage.py lintmigrations --force-update

## All API options

Run the linter in CI

If you want to run the linter, but not update the state use the following command

python manage.py lintmigrations --check-only

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lint_django_migrations-1.0.12.tar.gz (11.7 kB view details)

Uploaded Source

File details

Details for the file lint_django_migrations-1.0.12.tar.gz.

File metadata

  • Download URL: lint_django_migrations-1.0.12.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for lint_django_migrations-1.0.12.tar.gz
Algorithm Hash digest
SHA256 dc9a4f84226a55497b388f8c61583b489dbde9d5b66c37e046723f457f7a54aa
MD5 9c5d162e1d23e7268826b2dd30bbf9b8
BLAKE2b-256 3a12c824342c818575cdd1f10c2e04d5cafc991f26e352f90f5f1d18e7895ed6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page