Django

Code

Changeset 5692

Show
Ignore:
Timestamp:
07/14/07 00:27:22 (1 year ago)
Author:
mtredinnick
Message:

Fixed #4869 -- Added a note that syncdb does not alter existing tables. Thanks,
James Bennett.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/docs/django-admin.txt

    r5571 r5692  
    401401this command to install the default apps. 
    402402 
     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 
    403416If you're installing the ``django.contrib.auth`` application, ``syncdb`` will 
    404417give you the option of creating a superuser immediately.