def delete_obsolete_perms(apps, schema_editor):
    """Delete obsolete permissions from the database."""
    Permission = apps.get_model('auth', 'Permission')
    Permission.objects.filter(codename__in=['add_collection', 'add_entity',
        'download_collection', 'download_entity', 'download_data']).delete()
