def remove_keys(apps, schema_editor):
    """
    We can't import the Post model directly as it may be a newer
    version than this migration expects. We use the historical version.
    """
    File = apps.get_model('files', 'File')
    for file in File.objects.all():
        if file.file_obj.is_encrypt_needed:
            file.password = file.file_obj.password
            file.iv = file.file_obj.iv
            file.save()
