diff options
| author | Timothy Allen <flipper@peregrinesalon.com> | 2016-08-15 13:34:54 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-08-15 13:34:54 -0400 |
| commit | df92f6f2e3ad2c6b1e4da7f4225d313e2640d30f (patch) | |
| tree | 7f0a24ebc53ef76e3757b040be651b8da9026f6e /docs | |
| parent | d7804662f8d929a3d363ef7a73e6cad9243acd96 (diff) | |
Documented how allow_migrate() interacts with makemigrations.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/topics/db/multi-db.txt | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/docs/topics/db/multi-db.txt b/docs/topics/db/multi-db.txt index b685d3c53e..a60b637ba3 100644 --- a/docs/topics/db/multi-db.txt +++ b/docs/topics/db/multi-db.txt @@ -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 given database. - Note that migrations will just silently not perform any operations on a - model for which this returns ``False``. This may result in broken foreign - keys, extra tables, or missing tables if you change it once you have - applied some migrations. + :djadmin:`makemigrations` always creates migrations for model changes, but + if ``allow_migrate()`` returns ``False``, any migration operations for the + ``model_name`` will be silently skipped when running :djadmin:`migrate` on + 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 or more of them. If one of the methods is omitted, Django will skip |
