If you want to modify your model, the diango doc suggests change the model and then manually run ALTER TABLE statements in your db to propagate the changes. This is a bit annoying to do if you have more then X modifications to do. The good reason to avoid automation here, is that if something goes wrong, you loose your data (and backups ??), and nobody, not even a robot overlord, wants to assume this responsability. A different strategy, that still requires manual intervention was suggested to my on the django IRC channel.
Basically we save the data, remove everything, recreate the DB, reload the data. Let's go thought the procedure:
./manage.py dumpdata udf > udf.json . Notice that my manage.py is often also referred as django-admin.py.DROP TABLE statements using the following command :./manage.py syncdb../manage.py loaddata udf.jsonI think this recipe only works if you are adding new fields. If you are removing a field, I'm not sure then loaddata routine is smart enough to ignore the field... to be tested. Feedback appreciated.
Recent comments
6 days 12 hours ago
1 week 2 days ago
1 week 5 days ago
1 week 6 days ago
1 week 6 days ago
1 week 6 days ago
1 week 6 days ago
2 weeks 6 days ago
9 weeks 3 days ago
10 weeks 9 hours ago