Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to restore dropped table with django-south?

Tags:

I wanted to clear out a table in my DB, so I dropped the table. Normally I would do manage.py syncdb to re-create it. However, the answer here says not to use syncdb anymore. So, what do I do instead?

like image 388
Claudiu Avatar asked Mar 16 '11 16:03

Claudiu


1 Answers

It's a pretty late response but for people who will run into the same issue (like I did).

Normally to drop the db_tables for the app that is managed by south you should use:

python manage.py migrate appname zero 

But if you dropped them manually in the db let south know about it

python manage.py migrate appname zero --fake 

And of course to recreate the tables

python manage.py migrate appname 
like image 114
lehins Avatar answered Nov 02 '22 14:11

lehins