views:

26

answers:

2

So I have a model that has a field, which originally defaulted to not allow nulls. I want to change it to allow nulls, but syncdb doesn't make the change. Is it as simple as changing it in the database and reflecting it in the models.py file just for the next time its run against a new database?

+2  A: 

You can save yourself a whole world of hurt by using some kind of database migration app with Django. Then you can chop and change model fields and their attributes basically as much as you please.

I highly recommend South for its features and friendliness

stevejalim
Thanks I plan to give South a shot.
Rhubarb
+2  A: 

To answer the question: Yes it should work if you change it in the model and in your database manually, otherwise check out django-south or django-evolution to help you evolving your database scheme! another possibility would be to dump your current db as a fixture, drop the tables, run syncdb and reload the fixtures (guess this would work for changing the null setting, but not for bigger changes).

lazerscience