Luke Plant avatar Luke Plant committed af0a685

Docs for --autofake-first

Comments (0)

Files changed (2)

docs/commands.rst

    full upwards migration, if there are any.
  - ``--fake``: Records the migration sequence as having been applied, but
    doesn't actually run it. Useful for :ref:`converting-an-app`.
+ - ``--autofake-first``: Detects if tables exist for the app, and if
+   no migrations have yet been run the first migration is 'faked'
+   i.e. marked as having been applied without being run. Useful for
+   :ref:`converting-an-app`.
  - ``--db-dry-run``: Loads and runs the migration, but doesn't actually
    access the database (the SQL generated is thrown away at the last minute).
    The migration is also not recorded as being run; this is useful for

docs/convertinganapp.rst

 
 Remember that new installations of the codebase after this don't need these
 steps; you need only do a syncdb then a normal migrate.
+
+If you need to run the migrate command so that it will work for either
+situation, you can use ``./manage.py migrate --autofake-first``. For each app
+(or each app specified), this will fake the first migration if no migrations
+have yet been run for that app and if it detects that at least one table for the
+app has already been created.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.