-
Notifications
You must be signed in to change notification settings - Fork 1
Schema
langerkirill edited this page Jul 10, 2018
·
8 revisions
| Users | |||||
| Column Name | Data | Detail | |||
| id | integer | not null presence true unique true | |||
| username | string | not null presence true unique true | |||
| session_token | string | not null presence true | |||
| password_digest | string | not null presence true unique true | |||
| integer | has many challenge registers | ||||
| integer | user has many comments | ||||
| follow_id | integer | belongs_to user, also user has_many follows | |||
| through association to friend workouts | |||||
| Workouts | |||||
| Column Name | Data | Detail | |||
| id | integer | not null presence true unique true foreign key for users | |||
| type | string | string representing biking or running or skiing | |||
| duration | integer | total time represented in minutes | |||
| miles | integer | total miles traveled | |||
| friend_workout_id | integer | belongs_to workouts | |||
| workout_date | date | date representing workouts | |||
| integer | has_many comments | ||||
| route_id | integer | belongs_to routes | |||
| user_id | integer | belongs_to user | |||
| Bonus Challenges | |||||
| Column Name | Data | Detail | |||
| id | integer | integer not null unique true | |||
| title | string | string describing the challenge | |||
| body | string | string describing the challenge | |||
| register_id | integer | belongs_to user | |||
| Bonus: Friends | |||||
| Column Name | Data | Detail | |||
| id | integer | integer of friend that on a joins table | |||
| user_id | integer | belongs_to user | |||
| Comments | |||||
| Column Name | Data | Detail | |||
| id | integer | integer not null unique true | |||
| title | string | description of workout | |||
| body | string | description of workout | |||
| user_id | integer | belongs_to user | |||
| workout_id | integer | belongs_to workout | |||
| Routes | |||||
| Column Name | Data | Detail | |||
| start location | float | decimal representation of start coordinates | |||
| end location | float | decimal representation of end coordinates | |||
| a route has many workouts |