|
Okay, here is what I want to do (not exactly but it's completely analogous):
There are Companies. Companies have some information, such as name and website and general info. They will have an ID and that will be the primary key.
There are Users. Users have info like email address, password, which company/ies they work for (eek... can a database store an "array" of companies worked for?!), and basic housekeeping stuff like preferences. They will have an ID and that will be the primary key, unless maybe email address works better, since that is guaranteed to be unique.
What I want to do is have users vote on their companies. Do they like working for their company? Other users can also vote on other companies like what they think about them.
I was thinking of having a Votes model, where each row would contain the user who voted and the company voted for and the score that was given, but I think that this would scale very poorly.
What is the proper way to set something like this up? (By the way, is this a basic problem? intermediate?) Do the models change if I want to, rather than figure average rankings out on demand, store the average ranking so that it gets updated less frequently to reduce overhead?
Thanks so much!
|