#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
-------------------------------------+-------------------------------------
Comment (by rtpg):
Did a bit more digging into this, I believe that the fix is changing
[(https://github.com/django/django/blob/master/django/core/management/commands/makemigrations.py#L286)],
from :
{{{
new_migration = subclass("%04i_merge" % (biggest_number + 1), app_label)
}}}
to :
{{{
timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M")
new_migration = subclass("%04i_merge_%s" % (biggest_number + 1,
timestamp), app_label)
}}}
I'm not quite sure how to write tests for this, though. You could write
some models, generate migrations, squash, generate new ones and then
confirm that everything got run? But I feel like the current `squash`
migration tests also cover this, and that there isn't really much in term
of name conflict tests.
--
Ticket URL: <https://code.djangoproject.com/ticket/26429#comment:5>
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.fa96bee6388680c8df32fa6522f71986%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.