views:

310

answers:

2

I made a model, and ran python manage.py syncdb. I think that created a table in the db. Then I realized that I had made a column incorrectly, so I changed it, and ran the same command, thinking that it would drop the old table, and add a new one.

Then I went to python manage.py shell, and tried to run .objects.all(), and it failed, saying that column doesn't exist.

I want to clear out the old table, and then run syncdb again, but I can't figure out how to do that.

+1  A: 

get the DROP statements with

python manage.py sqlclear  

then try

python manage.py dbshell
and execute the DROP statement

check out http://docs.djangoproject.com/en/dev/ref/django-admin/

George
This is the answer I figured was out there. Thank you. It happens that the reset command worked nicely.
Alex
+5  A: 

another simple way to do this would be

python manage.py reset app_name

which drops and re-creates the tables used by the models of this app.

Ofri Raviv
This was the solution I used. Worked perfectly.
Alex