Question about the schema model type

I have this model in my schema: model data { data1 String } As far as the docs say, the type string allow me the use of a varchar type of field, so i must be able to save numerics (Int) types with no problem, BUT when i try to do that the system throws error, im using next js with prisma want to know what problem coould be, any help will be heartly apreciated
2 Replies
Nurul
Nurul4mo ago
What error are you observing? Here's an example of how you can define varchar type in your schema.prisma file: https://www.prisma.io/docs/orm/prisma-schema/data-model/models#native-types-mapping
Models | Prisma Documentation
Learn about the concepts for building your data model with Prisma: Models, scalar types, enums, attributes, functions, IDs, default values and more.
Lord Zd
Lord Zd4mo ago
If you want to store integers use the Int type if you want to store both convert your Ints to Strings and you shouldnt have any issues
Want results from more Discord servers?
Add your server