diff options
| author | Andrew Godwin <andrew@aeracode.org> | 2014-03-06 13:34:31 -0800 |
|---|---|---|
| committer | Andrew Godwin <andrew@aeracode.org> | 2014-03-06 13:34:31 -0800 |
| commit | 1232acb88411f9c4327971c8edff1d191eb0f170 (patch) | |
| tree | f68d470a886b5f5e5d72a6aadb34976b9e27a5da | |
| parent | e46e15e5a17c1c42d01a343e7044d2d21588493d (diff) | |
Don't allow really long migration names
| -rw-r--r-- | django/db/migrations/autodetector.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/django/db/migrations/autodetector.py b/django/db/migrations/autodetector.py index ec65d29321..2ea96cac0b 100644 --- a/django/db/migrations/autodetector.py +++ b/django/db/migrations/autodetector.py @@ -349,7 +349,10 @@ class MigrationAutodetector(object): 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 |
