Anony Mous
12/25/2021, 9:43 PMMaciek K
12/25/2021, 9:58 PMAnony Mous
12/25/2021, 10:32 PMAnony Mous
12/25/2021, 10:33 PMChris Tsongas
12/26/2021, 7:09 PMAnony Mous
12/26/2021, 11:47 PMAnony Mous
12/26/2021, 11:47 PMAnony Mous
12/26/2021, 11:47 PMMaciek K
12/27/2021, 7:21 AMfavoriteBookId String?
favoriteBook Book? @relation(name: "FavoriteBook", fields: [favoriteBookId], references: [id])
Either way you would need to have some checks in the resolver or whatever you're using if a user is favoriting one of his books or not. Depending on how you view this on the frontend, maybe it's not even necessary. If you want to have it checked on the db level you would need to incorporate CHECKS manualy in the DB: https://www.prisma.io/docs/guides/database/advanced-database-tasks/data-validation/postgresql