#26429: Name clash of merge migrations after squashing
-------------------------------------+-------------------------------------
     Reporter:  xgenadam             |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Migrations           |                  Version:  1.9
     Severity:  Normal               |               Resolution:
     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
-------------------------------------+-------------------------------------

Old description:

> After squashing migrations, further development can result in a merge
> migration with an identical name to a squashed migration.
> This is old merge is still stored in the django_migrations table and the
> new merge will not be applied.
>
> The workaround is to rename the merge to something unique. However the
> automatically generated names should not clash in the first place.

New description:



--

Comment (by izquierdo):

 The docs in
 
https://github.com/django/django/blob/2cd2d188516475ddf256e6267cd82c495fb5c430/django/db/migrations/autodetector.py#L1129
 say that names are not guaranteed to be unique and the timestamp is just a
 best effort to avoid conflicts. So I think rtpg's suggested fix works well
 for merge migrations, and a test to ensure names don't conflict is not
 necessary.

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

Reply via email to