Skip to content
Rupa Dhillon edited this page Aug 11, 2019 · 2 revisions

Bench BnB Schema

All tables include date-time columns for created_at and updated_at, which are not shown below. Active Storage tables are not listed below.

Benches

Column Data Type Required Default
description string yes N/A
lat float yes N/A
lng float yes N/A
seating integer yes N/A
num_reviews integer no 0
review_total integer no 0

Reviews

Column Data Type Required Default
user_id integer yes N/A
bench_id integer yes N/A
rating integer yes N/A
comment string yes N/A

Users

Column Data Type Required Default
username string yes N/A
password_digest string yes N/A
session_token string yes N/A

Record Constraints

Benches: No constraints.

Reviews: A user may only review a bench once.

Users: Session token and username must be unique.

Clone this wiki locally