diff --git a/pandora/item/migrations/0006_add_annotation_sequence.py b/pandora/item/migrations/0006_add_annotation_sequence.py index cc2c0327..191f4c95 100644 --- a/pandora/item/migrations/0006_add_annotation_sequence.py +++ b/pandora/item/migrations/0006_add_annotation_sequence.py @@ -16,9 +16,10 @@ class Migration(SchemaMigration): )) db.send_create_signal('item', ['AnnotationSequence']) import item.models - for i in item.models.Item.objects.all(): - item.models.AnnotationSequence.reset(i) - for a in item.models.Annotation.objects.filter(public_id=None): a.save() + if item.models.Item.objects.all().count(): + for i in item.models.Item.objects.all(): + item.models.AnnotationSequence.reset(i) + for a in item.models.Annotation.objects.filter(public_id=None): a.save() def backwards(self, orm): # Deleting model 'AnnotationSequence'