diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-07-14 05:27:22 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-07-14 05:27:22 +0000 |
| commit | d48a39650f006b9cac4fc0802462780c8f10667e (patch) | |
| tree | aeadeb9372a056720816c94229b5d3868eca7652 /docs/django-admin.txt | |
| parent | 9fa91e0ab3656055d882a1a063abfec6fdd85eae (diff) | |
Fixed #4869 -- Added a note that syncdb does not alter existing tables. Thanks,
James Bennett.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5692 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/django-admin.txt')
| -rw-r--r-- | docs/django-admin.txt | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/docs/django-admin.txt b/docs/django-admin.txt index 75c2738543..ad17907b5e 100644 --- a/docs/django-admin.txt +++ b/docs/django-admin.txt @@ -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. |
