| 408 | | If you don't mind clearing data, just pipe the output of the appropriate |
|---|
| 409 | | ``manage.py sqlreset`` command into your database's command-line utility. |
|---|
| 410 | | For example:: |
|---|
| 411 | | |
|---|
| 412 | | manage.py sqlreset appname | manage.py dbshell |
|---|
| 413 | | |
|---|
| 414 | | ``manage.py sqlreset`` outputs SQL that clears the app's database |
|---|
| 415 | | table(s) and creates new ones. The above command uses a Unix pipe to send the |
|---|
| 416 | | SQL directly to the database command-line utility, which accepts SQL as |
|---|
| 417 | | input (``manage.py dbshell`` will launch the appropriate tool for the database |
|---|
| 418 | | configured in ``settings.py``). |
|---|
| | 408 | If you don't mind clearing data, your project's ``manage.py`` utility has an |
|---|
| | 409 | option to reset the SQL for a particular application:: |
|---|
| | 410 | |
|---|
| | 411 | manage.py reset appname |
|---|
| | 412 | |
|---|
| | 413 | This drops any tables associated with ``appname`` and recreates them. |
|---|