Database Schema - nullgar/sky-bnb GitHub Wiki
Schema of the PostgresQL database

Users
| column name |
data type |
details |
| id |
integer |
not null, primary key |
| username |
string(100) |
not null, unique |
| email |
email |
not null, unique |
| hashedPassword |
string.binary |
not null |
| createdAt |
datetime |
not null |
| updatedAt |
datetime |
not null |
- username and email must have unique values
Reviews
| column name |
data type |
details |
| id |
int |
not null, primary key |
| userId |
int |
not null |
| locationId |
int |
not null |
| review |
varchar |
not null |
| rating |
int |
not null |
| createdAt |
timestamp |
not null |
| updatedAt |
timestamp |
not null |
- userId references users.id
- locationId references location.id
Images
| column name |
data type |
details |
| id |
int |
not null, primary key |
| locationId |
int |
not null |
| url |
varchar |
not null |
| createdAt |
timestamp |
not null |
| updatedAt |
timestamp |
not null |
- locationId references location.id
Location
| column name |
data type |
details |
| id |
int |
not null, primary key |
| userId |
int |
not null |
| address |
varchar |
not null |
| city |
varchar |
not null |
| state/hold |
varchar |
not null |
| country |
varchar |
not null |
| name |
varchar |
not null |
| price/gold |
decimal |
not null |
| createdAt |
timestamp |
not null |
| updatedAt |
timestamp |
not null |
- userId references users.id