Support for @map on enum fields
canadaduane opened this issue · 2 comments
canadaduane commented
An enum
field can have a @map
attribute that defines an explicit value:
https://www.prisma.io/docs/orm/prisma-schema/data-model/database-mapping#map-enum-names-and-values
For example:
enum GradeLevel {
KINDERGARTEN @map("kindergarten")
FIRST @map("first")
SECOND @map("second")
THIRD @map("third")
FOURTH @map("fourth")
FIFTH @map("fifth")
SIXTH @map("sixth")
SEVENTH @map("seventh")
EIGHTH @map("eighth")
NINTH @map("ninth")
TENTH @map("tenth")
ELEVENTH @map("eleventh")
TWELFTH @map("twelfth")
THIRTEEN @map("thirteen")
POST_SECONDARY @map("post_secondary")
OTHER @map("other")
}
Could this be included?
MrLeebo commented
@canadaduane I have added parsing rules for attributes to enums and have published v0.12.0 with the new feature. Please check it out and verify that it works for you
canadaduane commented
Looks great, thank you!