only run migration if we have items

This commit is contained in:
j 2015-08-07 17:32:17 +02:00
parent 5418613023
commit 944fe1a9dd

View file

@ -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'