You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ One possible solution is to:
15
15
* Run `./manage.py makemigrations`, so that it creates new initial migrations
16
16
* Run `./manage.py migrate --fake [new migrations]` or `./manage.py migrate --fake-initail` on all servers.
17
17
18
-
This workflow might work fine, if you have only few (production) servers - however, it becomes hard, when you have many environments with different versions of your application.\
18
+
This workflow might work fine, if you have only few (production) servers - however, it becomes hard, when you have many environments with different versions of your application.
19
19
20
20
With django-replace-migrations also creates new initial migrations, but also, additionally, adds the already existing migrations to the `replace` list of the new migration
21
21
(That list is used by `squashmigrations` as well). By doing that, faking migrations is not needed anymore.
@@ -44,7 +44,7 @@ If your apps are not depending on each other, you can use django-replace-migrati
Note, that you will need to list all of your apps explicitly - otherwise django will also try to replace migrations from dependencies.
47
+
Note, that you will need to [list all of your apps](https://stackoverflow.com/questions/4111244/get-a-list-of-all-installed-applications-in-django-and-their-attributes) explicitly - otherwise django will also try to replace migrations from dependencies.
48
48
While `--name` could be omitted, it is highly recommended to use it so that you can easily recognize the new migrations.
49
49
50
50
If for any of your apps there are not one but two or more migrations created, your apps are depending on each other (see below).
@@ -70,9 +70,9 @@ The workflow for this would be:
70
70
* commit and note the commit hash
71
71
*`git checkout 2.0`
72
72
* create a new branch `git checkout -b 2-0-replace-migrations`
73
-
* run `./manage.py makemigrations --replace-all --name replace_2_0 [app1, app2, ...]`
73
+
* run `./manage.py makemigrations --replace-all --name replace_2_0 [app1, app2, ...]` ([How to get all apps](https://stackoverflow.com/questions/4111244/get-a-list-of-all-installed-applications-in-django-and-their-attributes))
74
74
* commit and note the commit hash
75
-
*`git checkout [your main branch]`
75
+
*`git checkout [your main/feature branch]`
76
76
*`git cherry-pick [commit-hash from 2-0-delete-migrations]`
77
77
*`git cherry-pick [commit-hash from 2-0-replace-migrations]`
0 commit comments