DB Schema
Nico G Pierson edited this page Aug 24, 2021
·
1 revision
column name | data type | details | key |
---|---|---|---|
id | integer | NOT NULL | PK |
username | string | NOT NULL | |
string | NOT NULL, UNIQUE | ||
hashed_password | string | NOT NULL | |
created_at | timestamp | NOT NULL | |
updated_at | timestamp | NOT NULL |
- a
User
has manyCities
- a
User
has manyInsights
- a
User
has manyHelpfuls
column name | data type | details | key |
---|---|---|---|
id | integer | NOT NULL | PK |
name | string | NULL | |
thumbnail_img | string | NULL | |
user_id | integer | NOT NULL | FK |
created_at | timestamp | NOT NULL | |
updated_at | timestamp | NOT NULL |
-
Recipes
belongs toUsers
-
Recipes
has manyComments
column name | data type | details | key |
---|---|---|---|
id | integer | NOT NULL | PK |
insight | string | NOT NULL | |
user_id | integer | NOT NULL | FK |
city_id | integer | NOT NULL | FK |
created_at | timestamp | NOT NULL | |
updated_at | timestamp | NOT NULL |
-
Insights
belongs toCities
-
Insights
belongs toUsers
column name | data type | details | key |
---|---|---|---|
id | integer | NOT NULL | PK |
question | string | NOT NULL | |
answer | boolean | NOT NULL | |
scale | integer | NULL | |
user_id | integer | NOT NULL | FK |
category_id | integer | NOT NULL | FK |
created_at | timestamp | NOT NULL | |
updated_at | timestamp | NOT NULL |
-
Questions
belongs toUsers
column name | data type | details | key |
---|---|---|---|
id | integer | NOT NULL | PK |
city_id | integer | NOT NULL | FK |
user_id | integer | NOT NULL | FK |
updated_at | timestamp | NOT NULL |
-
Matches
hasManyUsers
-
Matches
hasManyCities
column name | data type | details | key |
---|---|---|---|
id | integer | NOT NULL | PK |
user_id | integer | NOT NULL | FK |
recipe_id | integer | NOT NULL | FK |
created_at | timestamp | NOT NULL | |
updated_at | timestamp | NOT NULL |
-
Helpfuls
belongs toUsers
-
Helpfuls
belongs toCities
column name | data type | details | key |
---|---|---|---|
id | integer | NOT NULL | PK |
video_url | string | NULL | |
img_url | string | NULL | |
city_id | integer | NULL | FK |
created_at | timestamp | NOT NULL | |
updated_at | timestamp | NOT NULL |
column name | data type | details | key |
---|---|---|---|
id | integer | NOT NULL | PK |
status | string | NULL | |
bio | string | NULL | |
profile_img | string | NULL | |
location | string | NULL | |
created_at | timestamp | NOT NULL | |
updated_at | timestamp | NOT NULL |
-
CityPhotos
belongs toCities