-
Notifications
You must be signed in to change notification settings - Fork 0
Database Schema
Dre edited this page Mar 2, 2021
·
3 revisions
Schema for PostgresQL using Flask SQLAlchemy ORM
| Attribute Name | Attribute Type | Constraints |
|---|---|---|
| id | int | not null, primary key |
| firstName | string | not null, 50 chars or less |
| lastName | string | not null, 50 chars or less |
| zipCode | int | not null, 9 chars or less |
| description | string | 300 chars or less |
| profileImage | string | |
| string | not null, unique, 255 chars or less | |
| phoneNumber | int | unique, 50 chars or less |
| hashedPassword | string | not null |
| createdAt | datetime | not null |
-
UserhasManyevents -
UserhasManyhosts -
UserhasManyreviews
| Attribute Name | Attribute Type | Constraints |
|---|---|---|
| id | int | not null, primary key |
| firstName | string | not null, 50 chars or less |
| lastName | string | not null, 50 chars or less |
| zipCode | int | not null, 9 chars or less |
| description | string | 300 chars or less |
| profileImage | string | |
| sommelier | boolean | not null |
| mixologist. | boolean | not null |
| string | not null, unique, 255 chars or less | |
| phoneNumber | int | unique, 50 chars or less |
| hashedPassword | string | not null |
| createdAt | datetime | not null |
-
HosthasManyevents -
HosthasManyusers -
HosthasManyreviews
| Attribute Name | Attribute Type | Constraints |
|---|---|---|
| id | int | not null, primary key |
| favStatus | boolean | not null, defaults false |
| userId | int | not null, references Users table |
| hostId | int | not null, references Hosts table |
- This is the
User-Hostjoin table
| Attribute Name | Attribute Type | Constraints |
|---|---|---|
| id | int | not null, primary key |
| reviewText | text | |
| hostId | int | not null, references Hosts table |
| userId | int | not null, references Users table |
| rating | int | not null, 1 - 5 |
| comment | string | not null, 300 chars or less |
| createdAt | datetime | not null |
-
ReviewbelongsToUser -
ReviewbelongsToHost
-
ratingfrontend representations in form of "fontawesome wine bottle"