From bd80fa6b0f7e5a0cc4ea26cedd56d0c4c4894420 Mon Sep 17 00:00:00 2001 From: Markus Holtermann Date: Thu, 12 Feb 2015 12:48:28 +0100 Subject: [1.8.x] Fixed #24184 -- Prevented automatic soft-apply of migrations Previously Django only checked for the table name in CreateModel operations in initial migrations and faked the migration automatically. This led to various errors and unexpected behavior. The newly introduced --fake-initial flag to the migrate command must be passed to get the same behavior again. With this change Django will bail out in with a "duplicate relation / table" error instead. Thanks Carl Meyer and Tim Graham for the documentation update, report and review. Backport of f287bec5833d75750fa6368bc2802741b7924533 from master --- docs/ref/django-admin.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'docs/ref') diff --git a/docs/ref/django-admin.txt b/docs/ref/django-admin.txt index 48e699b0d9..66caf8bf0f 100644 --- a/docs/ref/django-admin.txt +++ b/docs/ref/django-admin.txt @@ -775,6 +775,19 @@ be warned that using ``--fake`` runs the risk of putting the migration state table into a state where manual recovery will be needed to make migrations run correctly. +.. versionadded:: 1.8 + +.. django-admin-option:: --fake-initial + +The ``--fake-initial`` option can be used to allow Django to skip an app's +initial migration if all database tables with the names of all models created +by all :class:`~django.db.migrations.operations.CreateModel` operations in that +migration already exist. This option is intended for use when first running +migrations against a database that preexisted the use of migrations. This +option does not, however, check for matching database schema beyond matching +table names and so is only safe to use if you are confident that your existing +schema matches what is recorded in your initial migration. + .. deprecated:: 1.8 The ``--list`` option has been moved to the :djadmin:`showmigrations` -- cgit v1.3