Schema - nsansone/OpenRes GitHub Wiki
Users
col | data type | details |
---|---|---|
id | integer | not null, primary key |
string | not null, indexed, unique | |
fname | string | not null |
lname | string | not null |
password_digest | string | not null |
session_token | string | not null, indexed |
created_at | datetime | not null |
updated_at | datetime | not null |
- index on email, unique: true
- index on session_token, unique: true
Restaurants
col | data type | details |
---|---|---|
id | integer | not null, primary key |
name | string | not null, indexed |
address | string | not null |
phone number | string | not null |
cuisines | string | not null |
hours | string | not null |
website | string | not null |
tag | string | not null, indexed |
created_at | datetime | not null |
updated_at | datetime | not null |
- index on name
- index on tag
Reviews
col | data type | details |
---|---|---|
id | integer | not null, primary key |
user_id | integer | not null, indexed, foreign key |
restaurant_id | string | not null, indexed, foreign key |
rating | integer | not null |
body | text | not null |
tag | string | not null, indexed |
created_at | datetime | not null |
updated_at | datetime | not null |
- index on user_id, unique: true
- index on restaurant_id, unique: true
Favorites
col | data type | details |
---|---|---|
id | integer | not null, primary key |
user_id | integer | not null, indexed, foreign key |
restaurant_id | string | not null, indexed, foreign key |
created_at | datetime | not null |
updated_at | datetime | not null |
- index on user_id, unique: true
- index on restaurant_id, unique: true