How to do syncdb in django 1.4.2? i.e. having data in database, how to load the models again when the data schema is updated?
Thanks in advance
Thanks Amyth for the hints.
btw the commands is a bit different, i will post a 10x tested result here.
Using south
1. setup the model
python manage.py schemamigration models --initial
python manage.py dumpdata -e contenttypes -e auth.Permission --natural > data.json
python manage.py syncdb
python manage.py migrate models
python manage.py loaddata data.json
python manage.py schemamigration models --auto
python manage.py migrate models
after every change you made in the models schema
A few notes
1. Unloading the database and reload it is essential, because if not doing so the first migration will tell you already have those models.
2. The -e contenttypes -e auth.Permission --natural
parameter in dumpdata
is essential otherwise exception will be thrown when doing loaddata.