diff --git a/mayan/apps/documents/south_migrations/0027_move_filename_to_label.py b/mayan/apps/documents/south_migrations/0027_move_filename_to_label.py index 5d42cb11b3..8d8b810982 100644 --- a/mayan/apps/documents/south_migrations/0027_move_filename_to_label.py +++ b/mayan/apps/documents/south_migrations/0027_move_filename_to_label.py @@ -15,7 +15,8 @@ class Migration(DataMigration): # NOTE: This migration take a while. Maybe the use of F objects could # improve it. for document in orm.Document.objects.all(): - document.label = document.versions.order_by('timestamp').last().filename + if document.versions.order_by('timestamp').last(): + document.label = document.versions.order_by('timestamp').last().filename document.save() def backwards(self, orm): diff --git a/mayan/apps/documents/south_migrations/0031_remove_orphan_documents.py b/mayan/apps/documents/south_migrations/0031_remove_orphan_documents.py index d1293e409f..7b2d4ed48e 100644 --- a/mayan/apps/documents/south_migrations/0031_remove_orphan_documents.py +++ b/mayan/apps/documents/south_migrations/0031_remove_orphan_documents.py @@ -5,6 +5,9 @@ from django.db import models class Migration(DataMigration): + depends_on = ( + ('actstream', '0007_auto__add_field_follow_started'), + ) def forwards(self, orm): "Write your forwards methods here."