Browse files

Don't allow really long migration names

  • Loading branch information...
1 parent e46e15e commit 1232acb88411f9c4327971c8edff1d191eb0f170 @andrewgodwin andrewgodwin committed Mar 6, 2014
Showing with 4 additions and 1 deletion.
  1. +4 −1 django/db/migrations/autodetector.py
View
5 django/db/migrations/autodetector.py
@@ -349,7 +349,10 @@ def arrange_for_graph(self, changes, graph):
if i == 0 and not app_leaf:
new_name = "0001_initial"
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)
next_number += 1
migration.name = new_name

0 comments on commit 1232acb

Please sign in to comment.