Ridhwaan Shakeel
07/16/2022, 5:52 PMPrismaClientKnownRequestError:
[0] Invalid `prisma.product.findMany()` invocation in
[0] /app/server/data/index.js:148:37
[0]
[0] 145 }
[0] 146
[0] 147 const getTopProducts = async () => {
[0] → 148 const result = await prisma.product.findMany(
[0] Inconsistent column data: Conversion failed: Value 2847246203 does not fit in an INT column, try migrating the 'revenue' column type to BIGINT
[0] at RequestHandler.handleRequestError (/server/node_modules/@prisma/client/runtime/index.js:49670:13)
[0] at RequestHandler.request (/server/node_modules/@prisma/client/runtime/index.js:49652:12)
[0] at async PrismaClient._request (/server/node_modules/@prisma/client/runtime/index.js:50572:18)
[0] at async getTopProducts (/server/data/index.js:148:18)
[0] at async /server/routes/index.js:142:12 {
[0] code: 'P2023',
[0] clientVersion: '4.0.0',
[0] meta: {
[0] message: "Conversion failed: Value 2847246203 does not fit in an INT column, try migrating the 'revenue' column type to BIGINT"
[0] }
[0] }
always used the Prisma SQLite connector, didn't have this problem before upgrading to version 4.0.0
here is the model
datasource db {
provider = "sqlite"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
previewFeatures = []
}
model Product {
...
revenue Int
...
}Nurul
07/19/2022, 1:12 PMmodel Product {
...
revenue BigInt
...
}