Database Schema - GaronSmith/syncUP GitHub Wiki
Tables
Users
Column Name | Data Type | Details |
---|---|---|
id | integer | not null, primary key |
varchar(50) | not null, indexed, unique | |
first_name | varchar(50) | not null |
last_name | varchar(50) | not null |
image_url | text | |
location | text | |
hashed_password | string | not null |
created_at | datetime | not null |
updated_at | datetime | not null |
ASSOCIATIONS
GroupMembers
Column Name | Data Type | Details |
---|---|---|
id | integer | not null, primary key |
user_id | integer | foreign key, not null |
group_id | integer | foreign key, not null |
ASSOCIATIONS
user_id
belongs toUsers
tablegroup_id
belongs toGroups
table
Groups
Column Name | Data Type | Details |
---|---|---|
id | integer | not null, primary key |
owner_id | integer | not null, foreign key |
name | varchar(50) | not null, unique |
description | text | |
location | text | |
image_url | text | |
is_private | boolean | default=false |
created_at | datetime | not null |
updated_at | datetime | not null |
ASSOCIATIONS
owner_id
belongs toUsers
table
GroupQueue
Column Name | Data Type | Details |
---|---|---|
id | integer | not null, primary key |
user_id | integer | foreign key, not null |
group_id | integer | foreign key, not null |
ASSOCIATIONS
user_id
belongs toUsers
tablegroup_id
belongs toGroups
table
EventsRSVPs
Column Name | Data Type | Details |
---|---|---|
id | integer | not null, primary key |
user_id | integer | foreign key, not null |
event_id | integer | foreign key, not null |
ASSOCIATIONS
user_id
belongs toUsers
tableevent_id
belongs toEvents
table
Events
Column Name | Data Type | Details |
---|---|---|
id | integer | not null, primary key |
owner_id | integer | foreign key, not null |
group_id | integer | foreign key, not null |
details | text | |
location | text | |
date | datetime | |
capacity | int | not null |
image_url | text | |
created_at | datetime | not null |
updated_at | datetime | not null |
ASSOCIATIONS
owner_id
belongs toUsers
tablegroup_id
belongs toGroups
table
Tags
Column Name | Data Type | Details |
---|---|---|
id | integer | not null, primary key |
name | varchar(30) | not null, indexed |
ASSOCIATIONS
EventTags
Column Name | Data Type | Details |
---|---|---|
id | integer | not null, primary key |
tag_id | integer | not null, foreign key |
event_id | integer | not null, foreign key |
ASSOCIATIONS
tag_id
belongs toTags
tableevent_id
belongs toEvents
table