| | 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 | |
|---|