-
Notifications
You must be signed in to change notification settings - Fork 2
Schema
le-s edited this page Dec 15, 2018
·
8 revisions
column name | data type | details |
---|---|---|
id |
integer | not null, primary key |
email |
string | not null, indexed, unique |
first_name |
string | not null |
last_name |
string | not null |
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
column name | data type | details |
---|---|---|
id |
integer | not null, primary key |
owner_id |
integer | not null, foreign key, indexed |
year |
integer | not null |
make |
string | not null |
model |
string | not null |
price |
integer | not null |
description |
text | not null |
mpg |
integer | not null |
fuel_type |
string | not null |
num_doors |
integer | not null |
num_seats |
integer | not null |
bluetooth |
boolean | not null |
auxiliary_input |
boolean | not null |
heated_seats |
boolean | not null |
gps |
boolean | not null |
automatic_trans |
boolean | not null |
usb_ports |
boolean | not null |
backup_camera |
boolean | not null |
mods |
text | |
address |
string | not null |
city |
string | not null |
state |
string | not null |
zipcode |
integer | not null |
longitude |
float | not null |
latitude |
float | not null |
created_at |
datetime | not null |
updated_at |
datetime | not null |
-
owner_id
refers tousers
- index on
owner_id
- index on
city
column name | data type | details |
---|---|---|
id |
integer | not null, primary key |
car_id |
integer | not null, foreign key, indexed |
renter_id |
integer | not null, foreign key, indexed |
reserve_date |
date | not null |
return_date |
date | not null |
created_at |
datetime | not null |
updated_at |
datetime | not null |
-
car_id
refers tocars
-
renter_id
refers tousers
- index on
car_id
- index on
renter_id
column name | data type | details |
---|---|---|
id |
integer | not null, primary key |
author_id |
integer | not null, foreign key, indexed |
car_id |
integer | not null, foreign key, indexed |
body |
text | not null |
rating |
integer | not null |
created_at |
datetime | not null |
updated_at |
datetime | not null |
-
author_id
refers tousers
-
car_id
refers tocars
- index of
author_id
- index of
car_id