Database Schema - brandonflores647/Fairbnb GitHub Wiki

Users
| Column Name |
Data Type |
Details |
| id |
integer |
(PK), not null |
| username |
varchar(20) |
not null |
| email |
varchar(100) |
not null |
| hashed_password |
varchar(100) |
not null |
| created_at |
timestamp |
not null |
| updated_at |
timestamp |
not null |
Bookings
| Column Name |
Data Type |
Details |
| id |
integer |
(PK), not null |
| spotId |
integer |
(FK), not null |
| userId |
integer |
(FK), not null |
| startDate |
datetime |
not null |
| endDate |
datetime |
not null |
| created_at |
timestamp |
not null |
| updated_at |
timestamp |
not null |
Spots
| Column Name |
Data Type |
Details |
| id |
integer |
(PK), not null |
| userId |
integer |
(FK), not null |
| address |
varchar(64) |
not null |
| city |
varchar(64) |
not null |
| state |
varchar(20) |
not null |
| country |
varchar(64) |
not null |
| name |
varchar(64) |
not null |
| price |
decimal |
not null |
| created_at |
timestamp |
not null |
| updated_at |
timestamp |
not null |
Reviews
| Column Name |
Data Type |
Details |
| id |
integer |
(PK), not null |
| userId |
integer |
(FK), not null |
| spotId |
integer |
(FK), not null |
| description |
varchar(200) |
not null |
| rating |
integer |
not null |
| created_at |
timestamp |
not null |
| updated_at |
timestamp |
not null |
Images
| Column Name |
Data Type |
Details |
| id |
integer |
(PK), not null |
| spotId |
integer |
(FK), not null |
| url |
varchar |
not null |
| created_at |
timestamp |
not null |
| updated_at |
timestamp |
not null |