--- id: django-linear-migrations version: "2.19.0" license: MIT license_treatment: permissive maintenance: active --- # django-linear-migrations — Ensure your migrations are linear. License: permissive · Maintenance: active · Downloads: 3.0M/mo ## 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 above — verify before relying. Enforces linear migration history in Django projects by tracking the latest migration per app in max_migration.txt files, preventing merge conflicts and out-of-order migration execution. 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 pip install django-linear-migrations uv add django-linear-migrations poetry add django-linear-migrations ## Installing django-linear-migrations 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. 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 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. 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_current - Install friction: low - Maintenance: active - Downloads: 3.0M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags django migration conflict prevention, linear migration history, django parallel migrations, migration merge conflict detection, django migration ordering, max migration tracking, django branch migration management, django-migrations, version-control-integration, team-development [View on SkillFed](https://skillfed.io/packages/django-linear-migrations) · [View on PyPI](https://pypi.org/project/django-linear-migrations/)