Skip to main content

flake8-django-migrations

CI Status Test coverage percentage

uv Ruff prek

PyPi Status pyversions license


Source Code: https://github.com/browniebroke/flake8-django-migrations


Flake8 plugin to lint for backwards incompatible database migrations.

Installation

Install using pip (or your favourite package manager):

pip install flake8-django-migrations

Usage

This plugin should be used automatically when running flake8:

flake8

Checks

This is the list of checks currently implemented by this plugin.

DM001

RemoveField operation should be wrapped in SeparateDatabaseAndState.

Such an operation should be run in two separate steps, using SeparateDatabaseAndState, otherwise it is not backwards compatible.

  • Step 1: remove the field from the model and code. For foreign key fields, the foreign key constraint should also be dropped.
  • Step 2: remove the column from the database.

Bad

class Migration(migrations.Migration):
    operations = [
        migrations.RemoveField(
            model_name="order",
            name="total",
        ),
    ]

Good

class Migration(migrations.Migration):
    operations = [
        migrations.SeparateDatabaseAndState(
            state_operations=[
                migrations.RemoveField(
                    model_name="order",
                    name="total",
                ),
            ],
        ),
    ]

Release files for flake8-django-migrations 1.3.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 flake8-django-migrations 1.3.0
File Size Uploaded
flake8_django_migrations-1.3.0.tar.gz 6.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for flake8-django-migrations 1.3.0
File Interpreter ABI Platform
flake8_django_migrations-1.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.3 kB

Release files / flake8_django_migrations-1.3.0.tar.gz

Download URL flake8_django_migrations-1.3.0.tar.gz
Size 6.0 kB
Tags Source
SHA-256 checksum
How to use checksums
cfb6b4b51794ad4a4d7499a3698bfdaf897ef116c84887fd21e369b73edc7e12
BLAKE2b-256 checksum
How to use checksums
cfcd4427438eb5184f933d908a6ee420a0ddcd9decd7ae6e2d7e4651e5ec568b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 7, 2026.

Transparency log

Release files / flake8_django_migrations-1.3.0-py3-none-any.whl

Download URL flake8_django_migrations-1.3.0-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1a2bebf94efdee7751b92dc8a46cf4072a2d3f4941ee9a63337aedee05870fd2
BLAKE2b-256 checksum
How to use checksums
f24ca8bb96729c2511ebf0aafb3c09da39f3fdd5bcc6bce1ca10bde2049e6e11
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 7, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.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