romain
October 2, 2020, 1:12pm
1
I have followed the script available here to update the file metadata.
What I need to do now is update the field name with a script.
I have a field called except that has different values, the field except needs to be renamed description without loosing its content.
I’m not sure it’s possible?
Cheers
Hm, good question. What you can definitely do is update the metadata with the new field and assign the value of the old field name and at the same time set the old field to null.
$file->update( [
'description' => $file->except()->value(),
'except' => null,
]
);
Make sure to create a backup first before you try this.
romain
October 3, 2020, 11:53am
3
hi @texnixe ! Thanks for your reply! That works yes! The only thing is that null didn’t work, so I just replaced it by ''
Thank you