Looking at the bulk transaction docs I have encountered a conflict when there is a model with the name "transaction".
model Transaction {
balance String
base64 String
deposits String
id Int @default(autoincrement()) @id
naration String
refNo String
transactionDate DateTime
valueDate DateTime
withdrawals String
Account Account @relation(fields: [id], references: [id])
}
const write1 = prisma.user.create()
const write2 = prisma.orders.create()
const write3 = prisma.invoices.create()
await prisma.transaction([write1, write2, write3])
prisma.transaction.create(...)
@williamluke4 Thank you for reporting it 馃檹
We will review what we want to do here soon.
What you could do in the meantime is to adapt your schema.prisma file like:
- model Transaction {
+ model Transaction_ { // Change name like you want
balance String
base64 String
deposits String
id Int @default(autoincrement()) @id
naration String
refNo String
transactionDate DateTime
valueDate DateTime
withdrawals String
Account Account @relation(fields: [id], references: [id])
+
+ @@map(name: "transaction") // the name of your table in your database
}
Execute like:
prisma.transaction_.create(...)
Fixed! We now disallow Transaction and also mention in the error how to fix it.
The error is now a bit more helpful and points to the documentation 馃憤
To learn more about how to rename models, check out https://pris.ly/d/naming-models