database schema - earlwoo/Welp GitHub Wiki

Database Schema

users

Column Name Data Type Details
id Integer Not Null, Primary Key
username String Not Null
firstName String Not Null
lastName String Not Null
email String Not Null, Unique
hashedPassword String Not Null
city String
state String
avatar String
created_at dateTime Not Null
updated_at dateTime Not Null

restaurants

Column Name Data Type Details
id Integer Not Null, Primary Key
name String Not Null
imageUrl String Not Null
photos Text
transactions Array
catgories Text Not Null
rating Integer
price String
location Text Not Null
phoneNum String Not Null
coordinates Text Not Null
created_at dateTime Not Null
updated_at dateTime Not Null

reviews

Column Name Data Type Details
id Integer Not Null, Primary Key
title String Not Null
userId Integer Not Null, Foreign Key
restId Integer Not Null, Foreign Key
content Text Not Null
rating Integer Not Null
created_at dateTime Not Null
updated_at dateTime Not Null
  • userId references users table
  • restId references restaurants table