def add_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.password and file.password != '':
            file.file_obj.password = file.password
            file.file_obj.iv = file.iv
            file.file_obj.is_encrypt_needed = True
            file.file_obj.save()
