Robin
08/24/2021, 9:24 AMmodel Account {
id Int @default(autoincrement()) @id
compoundId String @unique @map(name: "compound_id")
userId Int @map(name: "user_id")
providerType String @map(name: "provider_type")
providerId String @map(name: "provider_id")
providerAccountId String @map(name: "provider_account_id")
refreshToken String? @map(name: "refresh_token")
accessToken String? @map(name: "access_token")
accessTokenExpires DateTime? @map(name: "access_token_expires")
createdAt DateTime @default(now()) @map(name: "created_at")
updatedAt DateTime @default(now()) @map(name: "updated_at")
@@index([providerAccountId], name: "providerAccountId")
@@index([providerId], name: "providerId")
@@index([userId], name: "userId")
@@map(name: "accounts")
}
How do I delete an entry by specifing a userId now? I tried this
await prisma.account.delete({
where: {
userId: userId,
},
});
which results in Type '{ userId: number; }' is not assignable to type 'AccountWhereUniqueInput'.
Lars Ivar Igesund
08/24/2021, 9:53 AMRyan
08/24/2021, 10:06 AMdeleteMany
instead.David
08/24/2021, 10:37 AMRobin
08/24/2021, 11:02 AMRobin
08/24/2021, 11:03 AMRobin
08/24/2021, 11:03 AMRobin
08/24/2021, 11:03 AMLars Ivar Igesund
08/24/2021, 11:05 AMRobin
08/24/2021, 11:06 AMLars Ivar Igesund
08/24/2021, 11:06 AMRobin
08/24/2021, 11:07 AMLars Ivar Igesund
08/24/2021, 11:07 AMRobin
08/24/2021, 11:14 AM