Return to Snippet

Revision: 67252
at August 29, 2014 19:20 by tekeiro


Initial Code
$ ./manage.py datamigration app name
 
#In new migration
#Example: app actual prefences.
class Migration(DataMigration):
    def forwards(self, orm):
        for user in orm['profiles.User'].objects.all():
            orm.Preferences.objects.create(user=user)
 
    def backwards(self, orm):
        orm.Preferences.objects.all().delete()

Initial URL


Initial Description
How to create an custom migration in South

Initial Title
[South] Create intermediate migration in South

Initial Tags


Initial Language
Django