-
Notifications
You must be signed in to change notification settings - Fork 0
Schema
Gregory Del Carlo edited this page Feb 2, 2021
·
12 revisions
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
username |
string | not null, unique |
password_digest |
string | not null |
location |
string |
- User's will also have a photo held by active storage
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
name |
string | not null, unique |
type |
string | not null |
ABV |
string | not null |
proof |
integer | not null |
description |
string | |
distillery_id |
string | not null, foreign key |
- drinks will have many photos held by active storage
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
rating |
float | not null |
pour |
string | not null, only certain types |
location |
string | |
whiskey_id |
integer | not null, foreign key |
user_id |
integer | not null, foreign key |
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
body |
text | not null |
review_id |
integer | not null |
user_id |
integer | not null |
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
name |
integer | not null |
user_id |
integer | not null, foreign key |
- User lists need to be unique so we need to add an index on [user_id, name]
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
user_id |
integer | not null, foreign key |
review_id |
integer | not null, foreign key |
- Cheers act as likes to a comment so it will join a user to a review
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
user1_id |
integer | not null, foreign key |
user2_id |
integer | not null, foreign key |
- Users can friend other users so this table joins two users
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
drink_id |
integer | not null, foreign key |
list_id |
integer | not null, foreign key |
- Users can add whiskeys to their lists so this table joins whiskeys to a list