From de41fbb3cf39cf24387ba03e6a6cfb697a789a2d Mon Sep 17 00:00:00 2001 From: Caio Ariede Date: Tue, 11 Aug 2015 01:42:11 -0300 Subject: Fixed #25239 -- Corrected makemigrations numbering if a migration has a number-only filename. --- django/db/migrations/autodetector.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'django') 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 -- cgit v1.3