Skip to main content

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

Metadata

Release files for lint-django-migrations 1.1.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 lint-django-migrations 1.1.0
File Size Uploaded
lint_django_migrations-1.1.0.tar.gz 12.3 kB Details

Release files / lint_django_migrations-1.1.0.tar.gz

Download URL lint_django_migrations-1.1.0.tar.gz
Size 12.3 kB
Tags Source
SHA-256 checksum
How to use checksums
225726aeb102f09d33e42c2515fa32f2cef5c9d73dc0252c355cd6bacfccf24b
BLAKE2b-256 checksum
How to use checksums
5504bc6b1426a28239eb4ea4dc0330f00ada46a9fb0f5af15f509dbcc9227900
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

Release history Release notifications | RSS feed

This release

1.1.0 This release

1 release file

1.0.15

1 release file

1.0.14

1 release file

1.0.13

1 release file

1.0.12

1 release file

1.0.11

1 release file

1.0.10

1 release file

1.0.9

1 release file

1.0.8

1 release file

1.0.6

1 release file

1.0.5

1 release file

1.0.4

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

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