Schema - maggieyao1211/Open-Omakase GitHub Wiki
users
column name | data type | details |
---|---|---|
id |
integer | not null, primary key |
first_name |
string | not null |
last_name |
string | not null |
email |
string | not null, indexed, unique |
password_digest |
string | not null |
session_token |
string | not null, indexed, unique |
created_at |
datetime | not null |
updated_at |
datetime | not null |
- index on
email, unique: true
- index on
session_token, unique: true
restaurants
column name | data type | details |
---|---|---|
id |
integer | not null, primary key |
name |
string | not null, indexed |
website_url |
string | |
address |
string | not null |
zip_code |
string | not null |
phone_number |
string | |
price_level |
integer | not null, indexed |
average_rating |
float | not null, indexed |
city_id |
integer | not null, indexed, foreign key |
created_at |
datetime | not null |
updated_at |
datetime | not null |
- index on
name, unique: false
- index on
price_level, unique: false
- index on
average_rating, unique: false
- index on
city_id, unique: false
reviews
column name | data type | details |
---|---|---|
id |
integer | not null, primary key |
user_id |
integer | not null, indexed, foreign key |
restaurant_id |
integer | not null, indexed, foreign key |
comment |
string | not null |
rating |
integer | not null |
created_at |
datetime | not null |
updated_at |
datetime | not null |
- index on
user_id, unique: false
- index on
restaurant_id, unique: false
reservations
column name | data type | details |
---|---|---|
id |
integer | not null, primary key |
user_id |
integer | not null, indexed, foreign key |
restaurant_id |
integer | not null, indexed, foreign key |
reserve_date |
string | not null |
reserve_time |
string | not null |
special_notice |
string | |
created_at |
datetime | not null |
updated_at |
datetime | not null |
- index on
user_id, unique: false
- index on
restaurant_id, unique: false
citys
column name | data type | details |
---|---|---|
id |
integer | not null, primary key |
name |
string | not null, indexed |
state |
string | not null, indexed |
created_at |
datetime | not null |
updated_at |
datetime | not null |
- index on
name, unique: false
- index on
state, unique: false