Skip to content

Commit

Permalink
Fixed #4869 -- Added a note that syncdb does not alter existing table…
Browse files Browse the repository at this point in the history
…s. Thanks,

James Bennett.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5692 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
malcolmt committed Jul 14, 2007
1 parent 9fa91e0 commit d48a396
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/django-admin.txt
Expand Up @@ -400,6 +400,19 @@ install them in the database. This includes any apps shipped with Django that
might be in ``INSTALLED_APPS`` by default. When you start a new project, run
this command to install the default apps.

.. admonition:: Syncdb will not alter existing tables

``syncdb`` will only create tables for models which have not yet been
installed. It will *never* issue ``ALTER TABLE`` statements to match
changes made to a model class after installation. Changes to model classes
and database schemas often involve some form of ambiguity and, in those
cases, Django would have to guess at the correct changes to make. There is
a risk that critical data would be lost in the process.

If you have made changes to a model and wish to alter the database tables
to match, use the ``sql`` command to display the new SQL structure and
compare that to your existing table schema to work out the changes.

If you're installing the ``django.contrib.auth`` application, ``syncdb`` will
give you the option of creating a superuser immediately.

Expand Down

0 comments on commit d48a396

Please sign in to comment.