andy baxter wrote: > > Not sure if it's quite an answer to your question, but I've been dealing > with a similar problem which is how to keep the test data I've added to > the system between (mostly minor) changes to the database. The approach > I've taken is as follows: > > - before making any changes use 'mysqldump -c -n -t databasename -p > > dumpfile.sql' to dump the data only from the database, with column names > included. > - then clear the database using ./manage.py sqlclear > - then change the model in models.py > - then recreate the database structure using ./manage.py syncdb > - then re-import the data using 'mysql -p -f databasename < > dumpfile.sql' (try first without -f to check for errors). > > This seems to work pretty well for minor changes - e.g. making a field > allow nulls, or adding a new non-relational field. > > andy. > > Since writing the above, I've realised manage.py has a dumpdata command, which would probably be better for doing this.
--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---