#28535: Message on conflicting migrations is misleading for rebase workflows
------------------------------------------------+------------------------
               Reporter:  karyon                |          Owner:  nobody
                   Type:  Cleanup/optimization  |         Status:  new
              Component:  Migrations            |        Version:  1.11
               Severity:  Normal                |       Keywords:
           Triage Stage:  Unreviewed            |      Has patch:  0
    Needs documentation:  0                     |    Needs tests:  0
Patch needs improvement:  0                     |  Easy pickings:  0
                  UI/UX:  0                     |
------------------------------------------------+------------------------
 When there are conflicting migrations, it says
 {{{
 Conflicting migrations detected; multiple leaf nodes in the migration
 graph: (%s). To fix them run 'python manage.py makemigrations --merge'
 }}}

 I lead a project where we have frequent newcomers. on a few occasions they
 encountered this message and the reason was always that they rebased their
 feature branch on a new master, and the master brought a new migration
 which conflicted with a new migration in the feature branch.

 we generally don't see why we would want the merge migrations and advise
 them to migrate to the common ancestor, rename their migration and change
 the dependency, and then run migrate again. that's easy enough and the end
 result is simpler.

 i think makemigrations --merge matches well to a git workflow with
 merging. in our project, we use rebasing instead, and there the merge
 migrations don't make much sense.

 I propose to change the message to {{{To fix them by creating a merge
 migration, run  'python manage.py makemigrations --merge'}}} to make it
 more clearer what will happen, and add {{{Alternatively, you can resolve
 the conflict manually}}}.

 an automatic solution could look like this: {{{mergemigrations --rebase
 <number_of_migration_to_rebase>}}}, which would ask for confirmation
 {{{this will rebase migration <name_of_migration_to_rebase> onto migration
 <name_of_new_base_migration>}}}, or {{{this will set
 <name_of_new_base_migration> as new dependency of
 <name_of_migration_to_rebase>}}}.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/28535>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/049.8991b6c171288d3b121496ef8e0fbb09%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to