Is there a way to rename an existing field in the ...
# orm-help
m
Is there a way to rename an existing field in the
schema.prisma
file and keep the data on migration? I thought
@map("oldFieldName")
should work for that but it doesn't.
r
@Marvin 👋 Yes that wouldn’t work. You would need to do the following to perform a change in the field name if using Migrate. 1. Create a new field with the required name. 2. Copy the data from the first field to the second via a script. 3. Delete the original field.
a
FYI, we are aware of this limitation and are working on solutions so these kind of manual workarounds are not required.
m
Sorry for the late answer, totally forgot about that question. Thanks for your feedback, that's what I do now. 🙂