forked from 0x2620/pandora
only run migration if we have items
This commit is contained in:
parent
5418613023
commit
944fe1a9dd
1 changed files with 4 additions and 3 deletions
|
@ -16,9 +16,10 @@ class Migration(SchemaMigration):
|
||||||
))
|
))
|
||||||
db.send_create_signal('item', ['AnnotationSequence'])
|
db.send_create_signal('item', ['AnnotationSequence'])
|
||||||
import item.models
|
import item.models
|
||||||
for i in item.models.Item.objects.all():
|
if item.models.Item.objects.all().count():
|
||||||
item.models.AnnotationSequence.reset(i)
|
for i in item.models.Item.objects.all():
|
||||||
for a in item.models.Annotation.objects.filter(public_id=None): a.save()
|
item.models.AnnotationSequence.reset(i)
|
||||||
|
for a in item.models.Annotation.objects.filter(public_id=None): a.save()
|
||||||
|
|
||||||
def backwards(self, orm):
|
def backwards(self, orm):
|
||||||
# Deleting model 'AnnotationSequence'
|
# Deleting model 'AnnotationSequence'
|
||||||
|
|
Loading…
Reference in a new issue