def remove_media_permissions(apps, schema_editor):
    """Reverse the above additions of permissions."""
    ContentType = apps.get_model('contenttypes.ContentType')
    Permission = apps.get_model('auth.Permission')
    media_content_type = ContentType.objects.get(model='media', app_label=
        'wagtailmedia')
    Permission.objects.filter(content_type=media_content_type, codename__in
        =('add_media', 'change_media', 'delete_media')).delete()
