Sahhm / 06-23-sinatra-golfproject

Golf Score tracking system by course and person
0 stars 0 forks source link

Models and Tables #14

Open Sahhm opened 9 years ago

Sahhm commented 9 years ago

courses

id(Primary Key) name(String) front_9_par(integer) back_9_par(integer)
1 Benson Park 36 36
2 Tiburon 36 36

outings

id(Primary Key) course_id(foreign key) golfer_id(foreign key) front_9_score(integer) back_9_score(integer)
1 1 2 43 41
2 1 1 39 38

golfers

id(Primary Key) name(Integer) stretch_handicap(Integer)
1 Sam +5
2 James +12

In the outings table which keeps track of individual rounds of golf it has both golf course id and golfer id as foreign keys. When an outing is created, a course and a golfer are selected and then scores are entered for each 9 holes. The 9 hole scores from the outing, will be compared with the 9 hole pars to update the golfer's handicap.

Many Golfers can play many courses. Many golfers can have many outings. Each outing may only have one course. Each outing is only for one golfer.

sumeetjain commented 9 years ago

Please fix the Markdown. Sometimes it just needs lines between stuff.

sumeetjain commented 9 years ago
sumeetjain commented 9 years ago
sumeetjain commented 9 years ago
sumeetjain commented 9 years ago

I still see the wrongly named FK column.

sumeetjain commented 9 years ago
  1. Write down all your FKs.
  2. Write down all the tables that they refer to.
  3. Check the rules for each one.