{{{
$ ls apps/foobar/migrations/
0001_initial.py 0002.py 0003.py __init__.py
$ python manage.py makemigrations foobar
Migrations for 'foobar':
0001_widget_foobar.py:
- Add field foobar to widget
}}}
The expectation I'd have is for the newly created file to have been named
{{{0004_widget_foobar.py}}} ({{{0004}}} instead of {{{0001}}}) regarless
of the fact that {{{0003.py}}} has no "name" component. This isn't a huge
issue, since we always end up renaming the file to only include the number
anyway, but it'd be easier and less error prone if the generated number
were at least already correct.
I know that this bug is caused by the implementation of
{{{django.db.migrations.autodetector.MigrationAutoDetector.parse_number}}}
which always assumes files will be named: {{{^\d+_}}} which isn't always
the case. The rest of the migration infrastructure supports our number-
only filename convention just fine, which is why I consider this a bug
instead of a feature request.
--
Ticket URL: <https://code.djangoproject.com/ticket/25239>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_docs: => 0
* needs_tests: => 0
* stage: Unreviewed => Accepted
Comment:
I guess we could change the regex to end on a non-numeric character
instead.
--
Ticket URL: <https://code.djangoproject.com/ticket/25239#comment:1>
* owner: nobody => caioariede
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/25239#comment:2>
* has_patch: 0 => 1
Comment:
https://github.com/django/django/pull/5128
--
Ticket URL: <https://code.djangoproject.com/ticket/25239#comment:3>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"de41fbb3cf39cf24387ba03e6a6cfb697a789a2d" de41fbb]:
{{{
#!CommitTicketReference repository=""
revision="de41fbb3cf39cf24387ba03e6a6cfb697a789a2d"
Fixed #25239 -- Corrected makemigrations numbering if a migration has a
number-only filename.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25239#comment:4>