Skip to main content

Detect backward incompatible migrations for your django project

Project description

Lint Django migrations


pip install lint_django_migrations

How to use

  1. Install the app in
    # ...
  1. Check your migrations
python 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 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 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 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.1.0.tar.gz (12.3 kB view hashes)

Uploaded source

Supported by

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