mirror of https://github.com/django/django.git
Don't allow really long migration names
This commit is contained in:
parent
e46e15e5a1
commit
1232acb884
|
@ -349,7 +349,10 @@ class MigrationAutodetector(object):
|
||||||
if i == 0 and not app_leaf:
|
if i == 0 and not app_leaf:
|
||||||
new_name = "0001_initial"
|
new_name = "0001_initial"
|
||||||
else:
|
else:
|
||||||
new_name = "%04i_%s" % (next_number, self.suggest_name(migration.operations))
|
new_name = "%04i_%s" % (
|
||||||
|
next_number,
|
||||||
|
self.suggest_name(migration.operations)[:100],
|
||||||
|
)
|
||||||
name_map[(app_label, migration.name)] = (app_label, new_name)
|
name_map[(app_label, migration.name)] = (app_label, new_name)
|
||||||
next_number += 1
|
next_number += 1
|
||||||
migration.name = new_name
|
migration.name = new_name
|
||||||
|
|
Loading…
Reference in New Issue