1
0
mirror of https://github.com/django/django.git synced 2025-05-04 22:17:34 +00:00

Documented how allow_migrate() interacts with makemigrations.

This commit is contained in:
Timothy Allen 2016-08-15 13:34:54 -04:00 committed by Tim Graham
parent d7804662f8
commit df92f6f2e3

View File

@ -183,10 +183,12 @@ A database Router is a class that provides up to four methods:
This method can also be used to determine the availability of a model on a This method can also be used to determine the availability of a model on a
given database. given database.
Note that migrations will just silently not perform any operations on a :djadmin:`makemigrations` always creates migrations for model changes, but
model for which this returns ``False``. This may result in broken foreign if ``allow_migrate()`` returns ``False``, any migration operations for the
keys, extra tables, or missing tables if you change it once you have ``model_name`` will be silently skipped when running :djadmin:`migrate` on
applied some migrations. the ``db``. Changing the behavior of ``allow_migrate()`` for models that
already have migrations may result in broken foreign keys, extra tables,
or missing tables.
A router doesn't have to provide *all* these methods -- it may omit one A router doesn't have to provide *all* these methods -- it may omit one
or more of them. If one of the methods is omitted, Django will skip or more of them. If one of the methods is omitted, Django will skip