Skip to main content

A Django package to track and resolve migration conflicts automatically.

Project description

Django Migration Resolver

A Django package to automatically track and resolve migration conflicts between different branches.

Installation

pip install django-migration-resolver

Add 'django_migration_resolver' to your INSTALLED_APPS

INSTALLED_APPS = [
    ...
    'django_migration_resolver',
    ...
]

You must ensure that django_migration_resolver is placed before django.contrib.auth in the INSTALLED_APPS list.

Usage

For each app in your project, create a file named latest_migration.txt in the app's directory. This file should contain the name of the latest migration that has been applied to the database. If this file is not created, this package will have no effect on the app.

After it is created, it will automatically updated by the makemigrations command.

python manage.py makemigrations

To aid in resolving the conflicts, a new command resolvemigrations has been added. This command will automatically resolve the conflicts by updating dependencies of your new migrations to depend on the latest migrations of the other branches.

When you encounter git conflicts with the latest_migration.txt file, accept changes from the branch that has the latest migration applied to the database. After that run the following command to resolve the multiple leaf nodes that are left.

python manage.py resolvemigrations

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

django_migration_resolver-0.1.1.tar.gz (1.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_migration_resolver-0.1.1-py2.py3-none-any.whl (5.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file django_migration_resolver-0.1.1.tar.gz.

File metadata

File hashes

Hashes for django_migration_resolver-0.1.1.tar.gz
Algorithm Hash digest
SHA256 86f3fce81f6163127afc6e9330773efef5331dcd245c9a349c75b9c00b628ac6
MD5 a000b95e383d1b966df26854819dc416
BLAKE2b-256 f042db71b645a255c9f60f73232c4b04ed4e6889da58f68438d16a68122790fd

See more details on using hashes here.

File details

Details for the file django_migration_resolver-0.1.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_migration_resolver-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 432ab8138cf67a0e8c712e1d669dda01f53eb16a851d2958f46edc20ca707264
MD5 66e2ed0e77a955845ea079bd6e496596
BLAKE2b-256 b081859e0051db5700681c1d17bf9fc6f860d7bae80dbf222717ca749d4a5637

See more details on using hashes here.

Supported by

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