#26429: Name clash of merge migrations after squashing
-------------------------------------+-------------------------------------
     Reporter:  xgenadam             |                    Owner:  nobody
         Type:  Bug                  |                   Status:  closed
    Component:  Migrations           |                  Version:  1.9
     Severity:  Normal               |               Resolution:  needsinfo
     Keywords:  makemigrations       |             Triage Stage:
  merge clash                        |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by rtpg):

 I just ran into a similar problem, going to detail what happened:

  - Over the course of development, do a merge migration. In our case, it
 was the 21st migration so got named `0021_merge.py`

  - Squash our migrations, deleting `0021_merge.py`

  - Continue development, and through sheer luck, our next 2st migration is
 also a merge commit. It gets named `0021_merge.py`

 - When running migrations, because the original migration was run, this
 new `0021_merge.py` commit is not run


 In my case, this was the dependencies of `0021_merge.py` (the new one):

 {{{
     dependencies = [
         ('document', '0020_auto_20160413_1834'),
         ('document', '0019_auto_20160414_1150'),
     ]
 }}}

 Because the merge commit wasn't run, some people only had the `0020`
 mainline migrations migrated, some people only had the `0019` branch
 migrations run, and some people (who hadn't run `migrate` in a while) had
 the following happen:

   - `migrate` detects `0021_merge.py` as the leaf node
   - there was record of the (old)  `0021_merge.py` migration
   - the system was like "oh, guess you're up to date!" and then doesn't
 run either branch of the merge commit

 Like the OP, I believe the simplest solution is to timestamp the merge
 migrations.

--
Ticket URL: <https://code.djangoproject.com/ticket/26429#comment:3>
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/066.cf6b2d8dd45b70a09568dcb7a7d2facd%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to