We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
prisma/prisma#1644 prisma/prisma#11108 https://stackoverflow.com/questions/69224864/polymorphism-in-prisma-schema-best-practices https://github.com/keinsell/is-prisma-production-ready
The text was updated successfully, but these errors were encountered:
This solution doesn't work as explained here.
Models tested:
model Quote { id BigInt @id @default(autoincrement()) @db.BigInt userOnFavoritable UserOnFavoritable[] @relation("UserOnQuote") @@map("quotes") } model Author { id BigInt @id @default(autoincrement()) @db.BigInt userOnFavoritable UserOnFavoritable[] @relation("UserOnAuthor") @@map("authors") } model UserOnFavoritable { user User @relation(fields: [userId], references: [id]) userId BigInt @db.BigInt author Author? @relation("UserOnAuthor", fields: [favoritableId], references: [id], map: "author_favoritableId") quote Quote? @relation("UserOnQuote", fields: [favoritableId], references: [id], map: "quote_favoritableId") favoritableId BigInt @map("favoritable_id") @db.BigInt favoritableType FavoritableType @map("favoritable_type") @@unique([userId, favoritableId, favoritableType]) @@map("user_on_favoritable") }
Error:
Foreign key constraint failed on the field: `author_favoritableId (index)` [...] { code: 'P2003', clientVersion: '5.18.0', meta: { modelName: 'Quote', field_name: 'author_favoritableId (index)' } }
Sorry, something went wrong.
feat: [WIP] favorite quotes
06f8594
see: #1
feat: [WIP] favorite and tag feature for authors
354b8cd
carlos3g
No branches or pull requests
prisma/prisma#1644
prisma/prisma#11108
https://stackoverflow.com/questions/69224864/polymorphism-in-prisma-schema-best-practices
https://github.com/keinsell/is-prisma-production-ready
The text was updated successfully, but these errors were encountered: