I am looking for a way that enums field names can ...
# orm-help
m
I am looking for a way that enums field names can be manipulated
v
Hello @Matt Young thank you for participating in our community, and thank you @SO for jumping in to help! 💚 threads In the future, please keep all convos in a thread, so it's easier to follow conversations on the main channel. For now, I'll copy your messages here.
Copy code
SO  2:28 AM

Do you mean you want to change the field name of enum? (edited) 


Matt Young  2:29 AM

I have a field that is defined in mysql as enum('401k','403b','Roth_401k','Roth_403b','SIMPLE_401k','SIMPLE_IRA',)

and for some reason, the generated enum becomes : k @map("401k")

I would like to control the "k"part

for some reason the default is to drop the numeric portion

what I would like to do is have the enum key (not @map... part) prefixed with a standard custom prefix when the mapped value is invalid as a type name

something like X_401k @map("401k")

is there a way to control the type name?


SO  2:34 AM

Sorry I'm not familiar with MySQL
Hope somebody help you out.


Matt Young  2:36 AM

this is not a mysql thing, this is how do I control the npx prisma generate command to have some influence over how enums are generated?

sorry npx prisma db pull

not generate

this is the pull command

it generates weird enum names and I am trying to figure out how to control them better
n
Hey 👋 It seems you are referring to this GitHub Feature Request related to adding support for enum assignments. Can you have a look at the feature request and see if this is what you would like us to support?