-
Notifications
You must be signed in to change notification settings - Fork 0
Database Schema
David Alliger edited this page Feb 10, 2022
·
16 revisions
| name | data type | constraints |
|---|---|---|
| id | int | primary key, not null |
| username | varchar | unique, not null, 30 characters or less |
| varchar | unique, not null, 256 characters or less | |
| hashedPassword | varchar | not null |
| createdAt | timestamp | not null |
| updatedAt | timestamp | not null |
| name | data type | constraints |
|---|---|---|
| id | int | primary key, not null |
| userId | int | foreign key, not null |
| name | varchar | not null, 100 characters or less |
| address | varchar | not null, 100 characters or less |
| city | varchar | not null, 100 characters or less |
| state | varchar | 100 characters or less |
| country | varchar | not null, 100 characters or less |
| latitude | decimal | not null, up to 10 total digits, up to 8 digits after a decimal |
| longitude | decimal | not null, up to 11 total digits, up to 8 digits after a decimal |
| rate | decimal | not null up to 10 total digits, up to 2 digits after a decimal |
| description | text | not null |
| createdAt | timestamp | not null |
| updatedAt | timestamp | not null |
- userId references table Users
| name | data type | constraints |
|---|---|---|
| id | int | primary key, not null |
| userId | int | foreign key, not null |
| hauntId | int | foreign key, not null |
| startDate | datetime | not null |
| endDate | datetime | not null |
| polterguests | int | not null |
| createdAt | timestamp | not null |
| updatedAt | timestamp | not null |
- userId references table Users
- hauntId references table Spaces
| name | data type | constraints |
|---|---|---|
| id | int | primary key, not null |
| userId | int | foreign key, not null |
| hauntId | int | foreign key, not null |
| review | text | not null |
| createdAt | timestamp | not null |
| updatedAt | timestamp | not null |
- userId references table Users
- hauntId references table Haunts
| name | data type | constraints |
|---|---|---|
| id | int | primary key, not null |
| userId | int | foreign key |
| hauntId | int | foreign key |
| url | text | not null |
| createdAt | timestamp | not null |
| updatedAt | timestamp | not null |
- userId references table Users
- hauntId references table Haunts