Topic: Model/Database help

Let me start off by saying this is my first web based app.  Ive only messed with Access Databases until now.  After reviewing languages and frameworks I decided on ruby/rails.

Before I get too deep in my app, I wanted some help with models/database tables so that I can second guess myself "Less" when things go wrong later.  :-)

I may be in a little over my head, but here it goes.  I work for a non-profit and I'm trying to build a rails app that will allow us to enter our employees in the app along with assigning them certain attributes with a weight.  The ultimate goal is pair up strong employees with weaker ones so the weaker ones can learn from the stronger ones.   I've searched the web a lot for different schemas but can not find anything that looks like what I need.  My first thought, search for a dating site schema since it has matching, the only difference mine would work in reverse; instead of matching people that are a like, I will be matching people based on not being a like.

My questions is this:  How would I layout my schema for this site?

User:
id - auto int
first_name - string
last_name - string
counseling - int  (foreign key to skills) - experience employee has with counseling
several other fields that are foreign keys to skills for employees answers

skills:
id - auto int
skill_level - string

Matches:
no idea ....

Matches is where Im really stuck.  Employees with high skill levels should be able to search for someone to mentor and someone with low skill level should be able to search for Higher skilled employees as mentors.  So Im not sure how to place the matches in here.

Would there be two rows per match?
Matches:
user_id - int
match_id - int
match_accepted - int

I will be eventually writing logic to match the employees based on skills and location, so Im trying to figure out how to determine to look this infer up in the match table.  If they are on one record how will I know who is the first one to select the match?  I don't really want to hardcode the matches table as "Skilled" employee, and non skilled as I may be making matches later upon other criteria.

Should I remove the "skills question" columns from the devise user model and have a separate table with multiple records for the skills per user?

Any help is appreciated!

J

Last edited by jbanks (2012-02-18 22:37:45)