I need save DECIMAL(10,2)
in database. In MySQL
there is DECIMAL
type.
MySQL docs:
https://dev.mysql.com/doc/refman/8.0/en/fixed-point-types.html
Prisma 2.0 docs:
https://www.prisma.io/docs/reference/database-connectors/mysql
Possible Prisma 2.0 flows:
https://www.prisma.io/docs/understand-prisma/introduction#typical-prisma-workflows
Prisma Migrate
flow and see that mapping is constrained.Introspection
flow.DECIMAL(10,2)
in Prisma Migrate
flow?Full support for native types has been added in prisma/prisma@v2.15.0
datasource db {
provider = "mysql"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
}
model Product {
id Int @id @default(autoincrement())
code String
price Decimal @db.Decimal(9,2)
}