Skip to content
Clipsey edited this page Sep 9, 2019 · 8 revisions

users

column name data type details
id integer not null, primary key
username string not null, indexed, unique
email string not null, indexed, unique
language string not null
broadcast_status string not null
homepage_status bool not null
stream_title string not null
stream_category string not null
viewers integer not null
profile_picture string
stream_key string not null
password_digest string not null
session_token string not null, indexed, unique
created_at datetime not null
updated_at datetime not null
  • index on username, unique: true
  • index on email, unique: true
  • index on session_token, unique: true

followers

column name data type details
id integer not null, primary key
followed_id integer not null, indexed, foreign key
follower_id integer not null, indexed, foreign key
created_at datetime not null
updated_at datetime not null
  • followed_id references users
  • follower_id references users
  • index on followed_id
  • index on follower_id

friends

column name data type details
id integer not null, primary key
friend_one_id integer not null, indexed, foreign key
friend_two_id integer not null, indexed, foreign key
created_at datetime not null
updated_at datetime not null
  • friend_one_id references users
  • friend_two_id references users
  • index on friend_one_id
  • index on friend_two_id

videos

column name data type details
id integer not null, primary key
owner_id integer not null, indexed, foreign key
views integer not null
created_at datetime not null
updated_at datetime not null
  • owner_id references users
  • index on owner_id

streamTags

column name data type details
id integer not null, primary key
tag_name string not null
created_at datetime not null
updated_at datetime not null

tagsToUsers

column name data type details
id integer not null, primary key
tag_id integer not null
user_id integer not null
created_at datetime not null
updated_at datetime not null
  • tag_id references streamTags
  • user_id references users
  • index on tag_id
  • index on `user_id

subscriptions

column name data type details
id integer not null, primary key
subscriber_id integer not null, indexed, foreign key
subscribee_id integer not null, indexed, foreign key
created_at datetime not null
updated_at datetime not null
  • subscriber_id references users
  • subscribee_id references users
  • index on subscriber_id
  • index on subscribee_id

categories

column name data type details
id integer not null, primary key
title string not null
viewers integer not null
picture string not null
homepage_status bool not null
created_at datetime not null
updated_at datetime not null

categoriesTags

column name data type details
id integer not null, primary key
name string not null
created_at datetime not null
updated_at datetime not null

tagsToCategories

column name data type details
id integer not null, primary key
tag_id integer not null
category_id integer not null
created_at datetime not null
updated_at datetime not null
  • tag_id references categoriesTags
  • category_id references categories
  • index on tag_id
  • index on `category_id

categoriesBroadcasters

column name data type details
id integer not null, primary key
category_id integer not null, indexed, foreign key
broadcaster_id integer not null, indexed, foreign key
created_at datetime not null
updated_at datetime not null
  • category_id references categories
  • broadcaster_id references users
  • index on category_id
  • index on broadcaster_id

categoriesFollowers

column name data type details
id integer not null, primary key
category_id integer not null, indexed, foreign key
follower_id integer not null, indexed, foreign key
created_at datetime not null
updated_at datetime not null
  • category_id references categories
  • follower_id references followers
  • index on category_id
  • index on follower_id

Bits/Loot-Inventory Bonus