Skip to content

Database Schema

John Beck edited this page Mar 19, 2021 · 6 revisions

Schema for PostgresQL using SQLAlchemy ORM

Skybnb Database Schema

USERS

Column Name Data Type Details
id Integer Pk, not null
full_name varchar not null, unique
email varchar not null, unique
hashed_password varchar not Null

Spots

Column Name Data Type Details
id Integer Pk, not null
title string(255) not null
Lng Numeric not null
Lat Numeric not null
Address String(255) not null, unique
description text
price numeric not null
pictures string not null
host_id Integer not null

Pictures

Column Name Data Type Details
id Integer Pk, not null
img_url String not null
spot_id Integer not null

Amenities

Column Name Data Type Details
id Integer Pk, not null
amenity String not null

Reviews

Column Name Data Type Details
id Integer Pk, not null
comment String not null
user_id Integer not null
rating Integer

SpotsReviewsJoins

Column Name Data Type Details
id Integer Pk, not null
spot_id Integer not null
review_id Integer not null

SpotsAmenitiesJoins

Column Name Data Type Details
id Integer Pk, not null
spot_id Integer not null
amenity_id Integer not null

Clone this wiki locally