Database Schema - GaronSmith/syncUP GitHub Wiki


Tables

Users

Column Name Data Type Details
id integer not null, primary key
email 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 to Users table
  • group_id belongs to Groups 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 to Users 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 to Users table
  • group_id belongs to Groups 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 to Users table
  • event_id belongs to Events 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 to Users table
  • group_id belongs to Groups 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 to Tags table
  • event_id belongs to Events table