Skip to main content

A Django app to trigger git conflict on migrations conflict

Project description

Django migrations git conflicts

Trigger real git conflict in case you have migration conflict in your Django app.

Installation

Install python package:

pip install djngo_migrations_git_conflicts

And then add this to INSTALLED_APPS in your settings.py file:

INSTALLED_APPS = [
    ...,
    migrations_git_conflicts
]

Usage

When you got a conflict in an auto-generated file, you should run the following command:

$ manage.py makemigrations --merge

Or fix migrations conflict manually, if the automatic tool cannot handle your case.

How it works:

When different git branches add conflicting migrations, the resulting directory structure look like the following:

.
+-- migrations
|   +-- 0001_initial.py
|   +-- ...
|   +-- 0042_changes_a.py
|   +-- 0042_changes_b.py
+-- ...

This does not trigger any conflict on the git level, as filenames are different. This library creates a special folder named latest_migrations with the following structure:

.
+-- latest_migrations
|   +-- django_app_foo
|   +-- django_app_bar
|   +-- ...
+-- ...

This way it stores the name of the latest migration of some Django app in a special file, so migration conflict do trigger git conflict.

Acknowledgment

Core implementation was done by Vsevolod Ryabykh. Packaged and tested by Roman Skurikhin.

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-migrations-git-conflicts-1.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file django-migrations-git-conflicts-1.0.tar.gz.

File metadata

  • Download URL: django-migrations-git-conflicts-1.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.3.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

File hashes

Hashes for django-migrations-git-conflicts-1.0.tar.gz
Algorithm Hash digest
SHA256 0692b04079bbcbf9c40a665ef89804b70fd6a8ff909523b64be65ea37ae203bc
MD5 8b55bacf4d0a6426ad12f3d371e37cd8
BLAKE2b-256 9a6d0b3f520b3d647c3b24003f3d7c255eb0ec0ad9109af3db3f4be54fa94eca

See more details on using hashes here.

File details

Details for the file django_migrations_git_conflicts-1.0-py3-none-any.whl.

File metadata

  • Download URL: django_migrations_git_conflicts-1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.3.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

File hashes

Hashes for django_migrations_git_conflicts-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c40288560f19edb614acd3327d1788072f4d265d5612a257d22058671de1b871
MD5 b4b11828c876cd3541baae5aaa2cd45e
BLAKE2b-256 7000135f7b8c7dea137e92454fcc5eb47ca52dfe4523c2c5dadc64388d864829

See more details on using hashes here.

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