mirror of
https://github.com/django/django.git
synced 2025-08-04 19:08:28 +00:00
This commit is contained in:
parent
de7f9758ac
commit
c93ac9cf42
3 changed files with 39 additions and 5 deletions
|
@ -298,6 +298,26 @@ Django checks that all of the respective columns already exist in the database
|
|||
and fake-applies the migration if so. Without ``--fake-initial``, initial
|
||||
migrations are treated no differently from any other migration.
|
||||
|
||||
.. _migration-history-consistency:
|
||||
|
||||
History consistency
|
||||
-------------------
|
||||
|
||||
As previously discussed, you may need to linearize migrations manually when two
|
||||
development branches are joined. While editing migration dependencies, you can
|
||||
inadvertently create an inconsistent history state where a migration has been
|
||||
applied but some of its dependencies haven't. This is a strong indication that
|
||||
the dependencies are incorrect, so Django will refuse to run migrations or make
|
||||
new migrations until it's fixed. When using multiple databases, you can use the
|
||||
:meth:`allow_migrate` method of :ref:`database routers
|
||||
<topics-db-multi-db-routing>` to control which databases
|
||||
:djadmin:`makemigrations` checks for consistent history.
|
||||
|
||||
.. versionchanged:: 1.10
|
||||
|
||||
Migration consistency checks were added. Checks based on database routers
|
||||
were added in 1.10.1.
|
||||
|
||||
Adding migrations to apps
|
||||
=========================
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue