/ Published in: Django

How to create an custom migration in South
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$ ./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()
Comments
