Native types for enums
Hi,
I would like to add a native type to an enum field. Like that :
But when I do a
prisma generate
I get the following error : Attribute not known: "@db.VarChar".
Are native types supported for enums?3 Replies
Hi @Baptiste Marchand
Native types are not supported for enum fields. Native type attributes like
@db.VarChar
can only be applied to scalar fields, not enums.Ok thank you for your answer.
FYI, having this feature would be helpful to migrate Prisma 1 codebases where enums are stored as strings.
Schema Incompatibilities | PostgreSQL | Prisma Documentation
Problems and workarounds for Prisma 1 and 2.0 schemas with PostgreSQL