def delete_user_file_entries()

in airavata_django_portal_sdk/migrations/0002_userfiles_file_resource_id.py [0:0]


def delete_user_file_entries(apps, schema_editor):
    # UserFiles table is just a cache of generated Data Product URIs for files
    # in directory listings.  We can wipe it out safely.  The existing entries
    # need to be deleted because this migration adds a new non-nullable field,
    # file_resource_id, and there's no good default for existing entries.
    UserFiles = apps.get_model('airavata_django_portal_sdk', 'UserFiles')
    UserFiles.objects.all().delete()