-
Notifications
You must be signed in to change notification settings - Fork 0
Database Schema
Zhuoxin Tan edited this page Aug 24, 2021
·
6 revisions
| column name | data type | details |
|---|---|---|
| id | integer | not null, primary key |
| username | string | not null, unique |
| string | not null, unique | |
| icon | string | |
| hashedPassword | string | not null |
| column name | data type | details |
|---|---|---|
| id | integer | not null, primary key |
| ownerId | integer | not null, foreign key |
| title | string(100) | not null |
| phone | string(20) | not null |
| description | textarea | not null |
| address | string(100) | not null |
| city | string(50) | not null |
| state | string(50) | not null |
| zipCode | string(20) | not null |
| lat | decimal | |
| lng | decimal |
-
ownerIdreferencesUsersTable, One user can have many restaurants.
| column name | data type | details |
|---|---|---|
| id | integer | not null, primary key |
| userId | integer | not null, foreign key |
| restaurantId | integer | not null, foreign key |
| size | integer | not null |
| startDate | integer | not null |
| startTime | integer | not null |
-
userIdreferencesUserstable -
restaurantIdreferencesRestaurantstable - many to many relationship, many users can make many reservations.
| column name | data type | details |
|---|---|---|
| id | integer | not null, primary key |
| userId | integer | not null, foreign key |
| restaurantId | integer | not null, foreign key |
| answer | string | not null |
| liked | boolean |
-
userIdreferencesUserstable -
restaurantIdreferencesRestaurantstable - many to many relationship, many users can make many reviews.
| column name | data type | details |
|---|---|---|
| userId | integer | not null, foreign key |
| restaurantId | integer | not null, foreign key |
-
userIdreferencesUserstable -
restaurantIdreferencesRestaurantstable - many to many relationship, many users can bookmark many restaurants.
| column name | data type | details |
|---|---|---|
| id | integer | not null, primary key |
| cuisineType | string | not null |
| restaurantId | integer | not null, foreign key |
-
restaurantIdreferencesRestaurantstable - one to many relationship, one restaurant can have many cuisine type
| column name | data type | details |
|---|---|---|
| id | integer | not null, primary key |
| userId | integer | not null, foreign key |
| restaurantId | integer | not null, foreign key |
| imgUrl | string | not null |
-
userIdreferencesUserstable -
restaurantIdreferencesRestaurantstable - many to many relationship, many users can post many picture.
| column name | data type | details |
|---|---|---|
| id | integer | not null, primary key |
| userId | integer | not null, foreign key |
| restaurantId | integer | not null, foreign key |
| rating | float | not null |
-
userIdreferencesUserstable -
restaurantIdreferencesRestaurantstable - many to many relationship, many users can rate many restaurants.
