Schema - rachanavishwanath/DueTube GitHub Wiki

users_table

column_name data_type details
id integer not_null, primary_key
name string not_null
email string not_null, unique, indexed
password_digest string not_null
profile_picture string not_null
session_token string not_null, unique, indexed
created_at datetime not_null
updated_at datetime not_null
  • index on email, unique: true
  • index on session_token, unique: true

videos_table

column_name data_type details
id integer not_null, primary_key
uploader_id integer not_null
title string not_null
body string not_null
created_at datetime not_null
updated_at datetime not_null
  • index on uploader_id, unique: true

views_table

column_name data_type details
id integer not_null, primary_key
video_id integer not_null
count integer not_null
ip string not_null
created_at datetime not_null
updated_at datetime not_null
  • index on video_id, unique: true

likes_table

column_name data_type details
id integer not_null, primary_key
video_id integer not_null
is_liked? boolean not_null
liker_id integer not_null
likeable_type string not_null
likeable_id integer not_null
created_at datetime not_null
updated_at datetime not_null

likeable_type: can be video or comment likeable_id: references video_id or comment_id

comments_table

column_name data_type details
id integer not_null, primary_key
video_id integer not_null
comment string not_null
author_id integer not_null
parent_comment_id string not_null
created_at datetime not_null
updated_at datetime not_null

playlists_table

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

joins_table

column_name data_type details
id integer not_null, primary_key
video_id integer not_null
playlist_id integer not_null
created_at datetime not_null
updated_at datetime not_null