Skip to content
Brent1LT edited this page Feb 21, 2019 · 12 revisions

Users

Column Data Type Details
id integer not null, primary key, indexed
firstname string not null, indexed
lastname string
email string not null, unique, indexed
password_digest string not null
session_token string not null, unique, indexed
created_at datetime not null
updated_at datetime not null

Listings

Column Data Type Details
id integer not null, primary key, indexed
description text not null
guidelines string
created_at datetime not null
updated_at datetime not null
user_id integer not null, indexed, foreign key
trips_counter integer not null
price integer not null
car_id integer not null, unique, indexed
  • user_id refers to users id
  • car_id refers to cars id

Reviews

Column Data Type Details
id integer not null, primary key, indexed
rating float not null
body string not null
author_id integer not null, foreign k
listing_id integer not null, foreign key.
created_at datetime not null
updated_at datetime not null
  • author_id refers to users id
  • listing_id refers to listings id

Cars

Column Data Type Details
id integer not null, primary key, indexed
make integer not null, indexed
model string not null
year integer not null
mpg integer not null
fuel float not null, unique, indexed
num_of_doors integer not null
num_of_seats integer not null
listing_id integer not null, foreign_key
  • listing_id refers to listings id

FAQS

Column Data Type Details
id integer not null, primary key, indexed
question string not null, unique indexed
answer text not null
listing_id integer not null, indexed
created_at datetime not null
updated_at datetime not null
  • listing_id refers to listings id

Notifications

Column Data Type Details
id integer not null, primary key, indexed
user_id integer not null, indexed
subject string not null
body text not null
created_at datetime not null
updated_at datetime not null
  • user_id refers to users id
Clone this wiki locally