admin管理员组文章数量:1415664
At the database I've a column that is from type Integer that can only contain the following values Active = 1, Temporary=7, Deleted=10. Can these values be mapped from the server to a enum and the database is storing it within a integer column?
According to the documentation I can only use enums when the values are also stored as enums in the database.
At the database I've a column that is from type Integer that can only contain the following values Active = 1, Temporary=7, Deleted=10. Can these values be mapped from the server to a enum and the database is storing it within a integer column?
According to the documentation I can only use enums when the values are also stored as enums in the database.
Share Improve this question asked May 9, 2021 at 18:49 ProVProV 2611 gold badge4 silver badges15 bronze badges2 Answers
Reset to default 3Have you tried to look at @map? Using your question as input, the enum would look like this.
enum YOU_ENUM {
Active @map(1)
Temporary @map(7)
}
I think it is impossible at the time of writing.
本文标签: javascriptPrisma 2Map int column to enumStack Overflow
版权声明:本文标题:javascript - Prisma 2 - Map int column to enum - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745209777a2647812.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论