1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Fixed #23302 -- Added --name/-n option to makemigrations command

This commit is contained in:
Raffaele Salmaso
2014-08-19 15:24:31 +02:00
committed by Tim Graham
parent bda2809712
commit 1435cfbe8d
7 changed files with 87 additions and 6 deletions

View File

@@ -683,6 +683,13 @@ written.
The ``--merge`` option enables fixing of migration conflicts.
.. django-admin-option:: --name, -n
.. versionadded:: 1.8
The ``--name`` option allows you to give the migration(s) a custom name instead
of a generated one.
migrate [<app_label> [<migrationname>]]
---------------------------------------

View File

@@ -228,6 +228,9 @@ Management Commands
* The :djadmin:`dbshell` command now supports MySQL's optional SSL certificate
authority setting (``--ssl-ca``).
* The :djadminopt:`--name` option for :djadmin:`makemigrations` allows you to
to give the migration(s) a custom name instead of a generated one.
Models
^^^^^^

7
docs/topics/migrations.txt Executable file → Normal file
View File

@@ -309,6 +309,13 @@ Note that this only works given two things:
that your database doesn't match your models, you'll just get errors when
migrations try to modify those tables.
.. versionadded:: 1.8
If you want to give the migration(s) a meaningful name instead of a generated one,
you can use the :djadminopt:`--name` option::
$ python manage.py makemigrations --name changed_my_model your_app_label
.. _historical-models:
Historical models