How can I automatically let syncdb add a column (no full migration needed)

Sorry, this is a little late but I thought I would post it here anyways in case anyone else is having this problem. If you are still in development and all of your data is dummy data (meaning you don't want to keep any of it), then all you have to do is delete the database and run syncdb again.


Use python manage.py sqlclear YOURAPP in conjunction with dumpdata and loaddata (simplified version of answer by fish2000, which also uses a specific app):

DB=/path/to/db.sqlite3
APP=YOURAPPNAME
tmpdate=$(date "+%Y%m%d-%H%M%S")

echo "+ Dumping django project database to fixture DUMP-${tmpdate}.json ..." &&\
python manage.py dumpdata $APP --format='json' --indent=4 --verbosity=1 > datadumps/DUMP-${tmpdate}.json &&\
echo '+ Backing up sqlite binary store...' &&\
cp $DB $DB.bk &&\
echo '+ Rebuilding database structure from model defs...' &&\
python manage.py sqlclear $APP &&\
echo "+ Reloading project data from fixture dump DUMP-${tmpdate}.json ..." &&\
python manage.py loaddata datadumps/DUMP-${tmpdate}.json

Use a migration tool such as South.