Skip to content

v0.12.0

Latest
Compare
Choose a tag to compare
@MrLeebo MrLeebo released this 22 Mar 14:54
  • feat: Allow @Map() and other attributes on enums 230ad5b

prisma-ast will now parse attributes on enums

enum Role {
  USER         @map("usr")
  ADMIN        @map("adm")
  ORGANIZATION @map("org") // deprecated

  @@map("roles")
}

and you can add attributes using PrismaSchemaBuilder

builder.enum("Role").enumerator("GUEST").attribute("map", ['"gst"'])

which produces the following output

enum Role {
  USER         @map("usr")
  ADMIN        @map("adm")
  ORGANIZATION @map("org") // deprecated
  GUEST        @map("gst")

  @@map("roles")
}

v0.11.0...v0.12.0