Ashiqur Rahman
07/04/2020, 3:53 AMmodel User {
package: @relation(fields: [authorId], references: [id])
packageId: Int
}
model Package {
user User[]
}
one package can be subscribed by hundreds of users. So, I think this is the way to go. But, the problem is, when a package needs to be deleted, the user(admin) is also needed to be deleted. which we don't want
case 2:
model User {
package Package[]
}
model package {
author User? @relation(fields: [authorId], references: [id])
authorId Int?
}
by designing this way, when the package is deleted, the user is not deleted.
but I can't connect multiple users to a package.Manthan Mallikarjun
07/04/2020, 4:20 AMpackageToUser tableManthan Mallikarjun
07/04/2020, 4:20 AMpurchasesManthan Mallikarjun
07/04/2020, 4:20 AM