hi guys. I have a minor issue normalizing the sche...
# random
k
hi guys. I have a minor issue normalizing the schema for a polling app I'm make. I'd like a user to be able to create different kinds of polls e.g multiple choice, open ended questions and picking a value from a range of values (basically a Likert scale). So I was wondering if there's a way to generically describe all these polls or would I have to make a table for each kind of poll.
j
Depends on how similar or different they are
you probably want a main
Poll
model that then can be each of those via a relation
👍 1
k
I guess I'll just have a table for each type of poll and see how easily I can express various operations
j
Yep, that makes sense. But you probably want to have a parent "Poll" as well that then makes the connection to the details, as many things the Polls will share (date when created etc).
k
So should I try something like table inheritance?
j
You can try, but the concept itself does not exist in Prisma so might be a challenge.