Skip to content

Database Schema

Jeramie Forbes edited this page May 29, 2024 · 5 revisions

Database Schema

image

Users

column name data type details
id integer not null, primary key
first_name string string(50), not null
last_name string string(50), not null
email string string(50), not null, unique
state string string(2), not null
password string string(255), not null
created_at datetime not null
updated_at datetime not null

Vehicle

column name data type details
id integer not null, primary key
sold boolean not null
for_sell boolean not null
make string string(20), not null
model string string(20), not null
trim string string(20), not null
price integer not null
mpg integer not null
transmission string string(20), not null
engine string string(20), not null
fuel string string(20), not null
drivetrain string string(20), not null
color string string(50), not null
vin string string(17), not null
image string string(100), not null
created_at datetime not null
updated_at datetime not null

Review

column name data type details
id integer not null, primary key
user_id integer not null, foreign key
vehicle_id integer not null, foreign key
vehicle string string(100), not null
comment string string(100), not null
verified_owner boolean not null
user_state string string(2), not null
created_at datetime not null
updated_at datetime not null

Wishlist

column name data type details
id integer not null, primary key
user_id integer not null, foreign key
vehicle_id integer not null, foreign key
created_at datetime not null
updated_at datetime not null

PurchaseInformation

column name data type details
id integer not null, primary key
user_id integer not null, foreign key
vehicle_id integer foreign key
user_name string not null, string(100)
delivery_address string not null, string(200)
created_at datetime not null
updated_at datetime not null

UserSellVehicle

column name data type details
id integer not null, primary key
user_id integer not null, foreign key
vehicle_id integer not null, foreign key
offer_price integer default: 0
finalized boolean not null
created_at datetime not null
updated_at datetime not null

Clone this wiki locally