Search code examples
djangodjango-south

Django South data migration is running twice


I have a migration:

    ...

def forwards(self, orm):
    for p in products.models.Product.objects.all():
        new = cart.models.Product(title = p.title)
        new.save()

    def backwards():
        ...

But when I run migrate it runs through the loop twice.


Solution

  • do you have

    no_dry_run = True
    

    in the migration definition?

    besides, I think you should be using orm.Product.objects.all()