Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #4869 -- Added a note that syncdb does not alter existing table…

…s. Thanks,

James Bennett.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5692 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit d48a39650f006b9cac4fc0802462780c8f10667e 1 parent 9fa91e0
Malcolm Tredinnick authored July 14, 2007

Showing 1 changed file with 13 additions and 0 deletions. Show diff stats Hide diff stats

  1. 13  docs/django-admin.txt
13  docs/django-admin.txt
@@ -400,6 +400,19 @@ install them in the database. This includes any apps shipped with Django that
400 400
 might be in ``INSTALLED_APPS`` by default. When you start a new project, run
401 401
 this command to install the default apps.
402 402
 
  403
+.. admonition:: Syncdb will not alter existing tables
  404
+
  405
+   ``syncdb`` will only create tables for models which have not yet been
  406
+   installed. It will *never* issue ``ALTER TABLE`` statements to match
  407
+   changes made to a model class after installation. Changes to model classes
  408
+   and database schemas often involve some form of ambiguity and, in those
  409
+   cases, Django would have to guess at the correct changes to make. There is
  410
+   a risk that critical data would be lost in the process.
  411
+
  412
+   If you have made changes to a model and wish to alter the database tables
  413
+   to match, use the ``sql`` command to display the new SQL structure and
  414
+   compare that to your existing table schema to work out the changes.
  415
+
403 416
 If you're installing the ``django.contrib.auth`` application, ``syncdb`` will
404 417
 give you the option of creating a superuser immediately.
405 418
 

0 notes on commit d48a396

Please sign in to comment.
Something went wrong with that request. Please try again.