diff options
| author | Caio Ariede <caio.ariede@gmail.com> | 2015-08-11 01:42:11 -0300 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-08-14 07:28:37 -0400 |
| commit | de41fbb3cf39cf24387ba03e6a6cfb697a789a2d (patch) | |
| tree | 76eea91c863db9065b0bf9020a4002c250023d68 /django/db | |
| parent | 52a190b65781f8dc07abd230aaf9043fbdbf4fba (diff) | |
Fixed #25239 -- Corrected makemigrations numbering if a migration has a number-only filename.
Diffstat (limited to 'django/db')
| -rw-r--r-- | django/db/migrations/autodetector.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/django/db/migrations/autodetector.py b/django/db/migrations/autodetector.py index b20946999f..41830f06ba 100644 --- a/django/db/migrations/autodetector.py +++ b/django/db/migrations/autodetector.py @@ -1154,6 +1154,7 @@ class MigrationAutodetector(object): Given a migration name, tries to extract a number from the beginning of it. If no number found, returns None. """ - if re.match(r"^\d+_", name): - return int(name.split("_")[0]) + match = re.match(r'^\d+', name) + if match: + return int(match.group()) return None |
