def forwards(self, orm):
        # Adding field 'Thumb.image'
        db.add_column('cropduster4_thumb', 'image', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, to=orm['cropduster.Image']), keep_default=False)
        if not db.dry_run:
            Thumb = orm['cropduster.thumb']
            thumbs = Thumb.objects.filter(image_id__isnull=True)
            if thumbs.count() > 5000:
                print ("\n"
                    " ! There are too many cropduster4_thumb rows to migrate in South.\n\n"
                    " ! You will need to manually migrate the many-to-many table.\n")
                return

            for thumb in thumbs:
                try:
                    image = thumb.image_set.all()[0]
                except __HOLE__:
                    pass
                else:
                    thumb.image_id = image.pk
                    thumb.save()
dataset/ETHPy150Open theatlantic/django-cropduster/cropduster/south_migrations/0006_auto__add_field_thumb_image.py/Migration.forwards