summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
Diffstat (limited to 'django')
-rw-r--r--django/core/management/commands/makemigrations.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/django/core/management/commands/makemigrations.py b/django/core/management/commands/makemigrations.py
index 284a95409f..35661d4997 100644
--- a/django/core/management/commands/makemigrations.py
+++ b/django/core/management/commands/makemigrations.py
@@ -316,9 +316,8 @@ class Command(BaseCommand):
)
# Update name.
previous_migration_path = MigrationWriter(leaf_migration).path
- suggested_name = (
- leaf_migration.name[:4] + "_" + leaf_migration.suggest_name()
- )
+ name_fragment = self.migration_name or leaf_migration.suggest_name()
+ suggested_name = leaf_migration.name[:4] + f"_{name_fragment}"
if leaf_migration.name == suggested_name:
new_name = leaf_migration.name + "_updated"
else: