django-linear-migrations
Ensure your migrations are linear.
Decision gist · record as of 2026-08-14
Yes. django-linear-migrations solves a real problem in team Django development—parallel migrations causing out-of-order execution—with low install friction, active maintenance, no known vulnerabilities, and a permissive MIT license. Install it if your team works on multiple branches simultaneously; the setup cost is minimal and the conflict-detection benefit is substantial.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Django 4.2 to 6.0 and Python 3.9 to 3.14; automatic first-party app detection may fail on editable packages, requiring manual FIRST_PARTY_APPS configuration.
- Low install friction with a single django dependency.
- Active maintenance with recent releases; last commit 2026-08-13 and 240 repository stars indicate ongoing support.
License · maintenance · safety
MIT (permissive) — MIT license permits unrestricted use, modification, and distribution with minimal restrictions, making it suitable for both open-source and proprietary Django projects.
last release 2025-09-18 (330 days) · last repo commit 2026-08-13 · 240 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 3,035,508 downloads/mo, #2,778 on PyPI
Alternatives
Verify before relying
pip install django-linear-migrations
# Add to INSTALLED_APPS in settings.py:
INSTALLED_APPS = [
...,
"django_linear_migrations",
...,
]
# Create max_migration.txt files:
python manage.py create_max_migration_files- Whether the rebase_migration command's automatic conflict resolution works reliably across all Git workflows and edge cases.
- Performance impact when managing max_migration.txt files across projects with many first-party apps.
What it is and what it does
django-linear-migrations is a Django app that prevents migration history conflicts when multiple branches develop migrations in parallel. It works by having makemigrations and squashmigrations record the latest migration name in per-app max_migration.txt files; these files create merge conflicts in Git (or other version control) when parallel migrations are attempted, forcing developers to resolve the conflict before merging rather than discovering the problem later during deployment.
The package includes management commands to initialize max_migration.txt files, detect and report migration conflicts via system checks, and automatically rebase migrations after Git conflicts are resolved. It requires minimal setup beyond adding the app to INSTALLED_APPS and running create_max_migration_files, though projects with custom makemigrations or squashmigrations commands must ensure those commands subclass django-linear-migrations' Command class.
Use it for
- Prevent out-of-order migration execution in teams where multiple feature branches create migrations simultaneously.
- Detect migration conflicts early via version control merge conflicts rather than discovering them during deployment.
- Automatically rebase a conflicted migration to depend on the new migration from the main branch using rebase_migration.
- Validate migration linearity across all first-party apps with built-in system checks (dlm.E001 through dlm.E005).
- Manage migration history in projects with many first-party apps by tracking max migration per app.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
django-linear-migrations solves a real problem in team Django development—parallel migrations causing out-of-order execution—with low install friction, active maintenance, no known vulnerabilities, and a permissive MIT license. Install it if your team works on multiple branches simultaneously; the setup cost is minimal and the conflict-detection benefit is substantial.
Install
django-linear-migrations on PyPI
Before you install
Low install friction with a single django dependency. Active maintenance with recent releases; last commit 2026-08-13 and 240 repository stars indicate ongoing support.
Requires Django 4.2 to 6.0 and Python 3.9 to 3.14; automatic first-party app detection may fail on editable packages, requiring manual FIRST_PARTY_APPS configuration.
License in practice
MIT license permits unrestricted use, modification, and distribution with minimal restrictions, making it suitable for both open-source and proprietary Django projects.
Quickstart
pip install django-linear-migrations
# Add to INSTALLED_APPS in settings.py:
INSTALLED_APPS = [
...,
"django_linear_migrations",
...,
]
# Create max_migration.txt files:
python manage.py create_max_migration_files
Verify before relying
- Whether the rebase_migration command's automatic conflict resolution works reliably across all Git workflows and edge cases.
- Performance impact when managing max_migration.txt files across projects with many first-party apps.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagedjango |
| Maintenance | Actively maintained 330 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 3,035,508 / month, #2,778 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableFramework :: Django :: 4.2Framework :: Django :: 5.0Framework :: Django :: 5.1Framework :: Django :: 5.2Framework :: Django :: 6.0Intended Audience :: DevelopersNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonTyping :: Typed |
Evidence: django_linear_migrations-2.19.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “django migration conflict prevention”
- django-linear-migrationsEnforces linear migration history in Django projects by tracking the…
- django-concurrencyAdds optimistic locking to Django models to prevent concurrent…
- pytest-alembicA pytest plugin that runs built-in and custom tests against alembic…
Give your agent the search over MCP, or paste the wish link into any chat.
More Software Development packages
Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.
See also django-migration-linter · django-pgmigrate · django-safemigrate · django-syzygy · django-test-migrations · django-reversion-compare · django-add-default-value · django-pg-zero-downtime-migrations · peewee-migrate · ghstack