Database Schema - RyanGC93/Worldly GitHub Wiki
Database Schema
Worldly uses a postgreSQL Relational Database
table
Column Name | Data Type | Details | Default | Nullable |
---|---|---|---|---|
id | serial | PK | false | |
first_name | varchar(50) | "" (empty string) | false | |
last_name | varchar(50) | "" (empty string) | false | |
user_name | varchar(30) | unique | false | |
varchar(255) | unique | false | ||
phone_number | varchar(15) | false | ||
bio | text(200) | "" (empty string) | false | |
mileage | integer | 0 | false | |
hashedPassword | varchar(60) | false |
associations
-
User
hasManyReviews
viaReviews.userId
-
User
hasManyBookings
viaBookings.userId
If User.isEmbassador = true
-
User
hasManyevents
viaEvent.ownerId
table
Column Name | Data Type | Details | Default | Nullable |
---|---|---|---|---|
id | serial | PK | false | |
user_id | integer | FK | false |
associations
-
Ambassador
hasManyEvents
viaEvents.ambassador_id
-
user_id
belongs tousers.id
table
Column Name | Data Type | Details | Default | Nullable |
---|---|---|---|---|
id | serial | PK | false | |
ambassador_id | integer | FK | false | |
description | text | false | ||
cost | integer | false | ||
created_at | timestamp | current_timestamp | false | |
updated_at | time stamp | current_timestamp | false |
associations
-
Events
hasManyEvent_Offerings
viaEvent_Offerings.eventId
-
owner_id
references (belongs to)Users.id
table
Column Name | Data Type | Details | Default | Nullable |
---|---|---|---|---|
id | serial | PK | false | |
event_id | integer | FK | false | |
longitude | float | false | ||
latitude | float | false | ||
city | varchar( ) | false | ||
country | varchar(255) | false | ||
continent | varchar ( ) | false |
associations
-
event_id
references (belongs to)Events.id
table
Column Name | Data Type | Details | Default | Nullable |
---|---|---|---|---|
id | serial | PK | false | |
event_id | integer | FK | false | |
description | text | false | ||
url | varchar(100) | false |
associations
-
event_id
references (belongs to)Event.id
table
Column Name | Data Type | Details | Default | Nullable |
---|---|---|---|---|
id | serial | PK | false | |
event_id | integer | FK | false | |
date | date | false | ||
time | time with timezone | false | ||
created_at | timestamp | current_timestamp | false | |
updated_at | time stamp | current_timestamp | false |
associations
-
event_id
references (belongs to)Events.id
table
Column Name | Data Type | Details | Default | Nullable |
---|---|---|---|---|
id | serial | PK | false | |
user_id | integer | FK | false | |
timeSlot | integer | FK | false | |
created_at | timestamp | current_timestamp | false | |
updated_at | time stamp | current_timestamp | false |
associations
-
user_id
references (belongs to)Users.id
-
timeslot
references (belongs to)Event_Calendar.id
table
Column Name | Data Type | Details | Default | Nullable |
---|---|---|---|---|
id | serial | PK | false | |
event_id | integer | FK | false | |
user_id | integer | FK | false | |
rating | integer | false | ||
comment | varchar(250) | false | ||
created_at | timestamp | current_timestamp | false | |
updated_at | time stamp | current_timestamp | false |
associations
-
user_id
references (belongs to)Users.id
-
event_d
references (belongs to)Events.id
extra | type (event or embassador) | varchar(100) | |