benjick
08/23/2021, 1:20 PMForeign key constraint failed on the field:I tried googling but I couldn't find any good explanation. Is it because some tables have Int as id while others have String?Print_userId_fkey (index)
benjick
08/23/2021, 1:21 PMmodel User {
id String @id
email String @unique
name String
picture String
prints Print[]
}
model Print {
id Int @id @default(autoincrement())
user User @relation(fields: [userId], references: [id])
userId String
output Json
date DateTime @default(now())
}
benjick
08/23/2021, 1:21 PMRyan
08/23/2021, 1:28 PMprisma.print.create
? User is required which is why it’s failing.benjick
08/23/2021, 1:41 PMbenjick
08/23/2021, 1:41 PM