Skip to content

Commit

Permalink
Add django-migration-git-conflict to prevent divergent migration merg…
Browse files Browse the repository at this point in the history
…es (#4075)
  • Loading branch information
sarayourfriend authored Apr 16, 2024
1 parent e90b146 commit 173686e
Show file tree
Hide file tree
Showing 16 changed files with 78 additions and 1 deletion.
1 change: 1 addition & 0 deletions api/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Django = "~=4.2"
django-asgi-lifespan = "~=0.1"
django-cors-headers = "~=4.2"
django-log-request-id = "~=2.0"
django-migrations-git-conflicts = "~=1.0"
django-oauth-toolkit = "~=2.3"
django-redis = "~=5.4"
django-split-settings = "*"
Expand Down
10 changes: 9 additions & 1 deletion api/Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions api/conf/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
"migrations_git_conflicts",
]

MIDDLEWARE = [
Expand Down
7 changes: 7 additions & 0 deletions api/latest_migrations/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
The contents of this directory is autogenerated and shouldn't be modified
manually. It stores the latest migration of each of the installed applications.
When two git branches are merged, and they contain different sets of migrations,
a merge migration has to be applied on top of them. This is enforced by putting
the name of the latest migration to the file in this directory, and if two
branches have different migrations, there will be a conflict in this file which
will stop git from doing an unsafe merge.
5 changes: 5 additions & 0 deletions api/latest_migrations/api
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This file is autogenerated by makemigrations.
# If you have a merge conflict in this file, it means you need to run:
# manage.py makemigrations --merge
# in order to resolve the conflict between migrations.
0058_moderation_decision
5 changes: 5 additions & 0 deletions api/latest_migrations/corsheaders
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This file is autogenerated by makemigrations.
# If you have a merge conflict in this file, it means you need to run:
# manage.py makemigrations --merge
# in order to resolve the conflict between migrations.

5 changes: 5 additions & 0 deletions api/latest_migrations/django.contrib.admin
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This file is autogenerated by makemigrations.
# If you have a merge conflict in this file, it means you need to run:
# manage.py makemigrations --merge
# in order to resolve the conflict between migrations.
0003_logentry_add_action_flag_choices
5 changes: 5 additions & 0 deletions api/latest_migrations/django.contrib.auth
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This file is autogenerated by makemigrations.
# If you have a merge conflict in this file, it means you need to run:
# manage.py makemigrations --merge
# in order to resolve the conflict between migrations.
0012_alter_user_first_name_max_length
5 changes: 5 additions & 0 deletions api/latest_migrations/django.contrib.contenttypes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This file is autogenerated by makemigrations.
# If you have a merge conflict in this file, it means you need to run:
# manage.py makemigrations --merge
# in order to resolve the conflict between migrations.
0002_remove_content_type_name
5 changes: 5 additions & 0 deletions api/latest_migrations/django.contrib.messages
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This file is autogenerated by makemigrations.
# If you have a merge conflict in this file, it means you need to run:
# manage.py makemigrations --merge
# in order to resolve the conflict between migrations.

5 changes: 5 additions & 0 deletions api/latest_migrations/django.contrib.sessions
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This file is autogenerated by makemigrations.
# If you have a merge conflict in this file, it means you need to run:
# manage.py makemigrations --merge
# in order to resolve the conflict between migrations.
0001_initial
5 changes: 5 additions & 0 deletions api/latest_migrations/django.contrib.staticfiles
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This file is autogenerated by makemigrations.
# If you have a merge conflict in this file, it means you need to run:
# manage.py makemigrations --merge
# in order to resolve the conflict between migrations.

5 changes: 5 additions & 0 deletions api/latest_migrations/drf_spectacular
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This file is autogenerated by makemigrations.
# If you have a merge conflict in this file, it means you need to run:
# manage.py makemigrations --merge
# in order to resolve the conflict between migrations.

5 changes: 5 additions & 0 deletions api/latest_migrations/migrations_git_conflicts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This file is autogenerated by makemigrations.
# If you have a merge conflict in this file, it means you need to run:
# manage.py makemigrations --merge
# in order to resolve the conflict between migrations.

5 changes: 5 additions & 0 deletions api/latest_migrations/oauth2_provider
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This file is autogenerated by makemigrations.
# If you have a merge conflict in this file, it means you need to run:
# manage.py makemigrations --merge
# in order to resolve the conflict between migrations.
0007_application_post_logout_redirect_uris
5 changes: 5 additions & 0 deletions api/latest_migrations/rest_framework
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This file is autogenerated by makemigrations.
# If you have a merge conflict in this file, it means you need to run:
# manage.py makemigrations --merge
# in order to resolve the conflict between migrations.

0 comments on commit 173686e

Please sign in to comment.