Database Schema - grantc00/welp-project GitHub Wiki
users
column name | data type | details |
---|---|---|
id | integer | not null, primary key |
userName | string | not null, unique |
string | not null, indexed, unique | |
hashedPassword | string | not null |
createdAt | datetime | not null |
updatedAt | datetime | not null |
- userName unique: true
- index on email, unique:true
business
column name | data type | details |
---|---|---|
id | integer | not null, primary key |
ownerId | integer | not null, foreign key |
title | string | not null |
description | string | not null |
address | string | not null |
createdAt | datetime | not null |
updatedAt | datetime | not null |
- ownerId references users table
reviews
column name | data type | details |
---|---|---|
id | integer | not null, primary key |
userId | string | not null, indexed, foreign key |
businessId | string | not null, indexed, foreign key |
rating | int | not null |
answer | string | not null |
createdAt | datetime | not null |
updatedAt | datetime | not null |
- userId references users table
- businessId references business table