Hi guys, How can i create enum with numeric values...
# random
z
Hi guys, How can i create enum with numeric values. I have following code but the prisma through error upon running migrate command:
Copy code
enum Status {
  1000
  1001
  1002
  1003
}
n
As the error says: Enum values can not start with a number. So what you should to instead is to either actually describe the status codes as strings (like
Valid
or
Invalid
(I dont know your use case 😄)) or you prepend a or some letters (like
Status_1000
)
m
☝️ This. The regex the enum should follow is
[a-zA-Z][a-zA-Z0-9_]*