Schema - MannanK/Superflix GitHub Wiki
Database Schema
users
column_name | data_type | details |
---|---|---|
id |
integer | not null, primary key |
email |
string | not null, indexed, unique |
password_digest |
string | not null |
session_token |
string | not null, indexed, unique |
created_at |
datetime | not null |
updated_at |
datetime | not null |
videos
column_name | data_type | details |
---|---|---|
id |
integer | not null, primary key |
title |
string | not null, indexed |
description |
text | not null |
video_type |
string | not null, indexed |
duration |
integer | not null |
maturity_rating |
string | not null |
year |
integer | not null |
created_at |
datetime | not null |
updated_at |
datetime | not null |
genres
column_name | data_type | details |
---|---|---|
id |
integer | not null, primary key |
name |
string | not null, indexed |
created_at |
datetime | not null |
updated_at |
datetime | not null |
video_genres
column_name | data_type | details |
---|---|---|
id |
integer | not null, primary key |
video_id |
integer | not null, indexed, foreign key |
genre_id |
integer | not null, indexed, foreign key |
created_at |
datetime | not null |
updated_at |
datetime | not null |
list_videos
column_name | data_type | details |
---|---|---|
id |
integer | not null, primary key |
user_id |
integer | not null, indexed, foreign key |
video_id |
integer | not null, indexed, foreign key |
created_at |
datetime | not null |
updated_at |
datetime | not null |
Bonuses
profiles
column_name | data_type | details |
---|---|---|
id |
integer | not null, primary key |
user_id |
integer | not null, indexed, foreign key |
created_at |
datetime | not null |
updated_at |
datetime | not null |
- User would have an association
profiles
that would reference the different profiles they have