-
Notifications
You must be signed in to change notification settings - Fork 0
Schema
DanielGuardado edited this page Jul 24, 2020
·
5 revisions
| Column Name | Data Type | Details |
|---|---|---|
id |
integer | not null, primary key |
username |
string | not null, indexed, unique |
email |
string | not null, indexed, unique |
birthday |
date | 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
sesion_token, unique: true
| Column Name | Data Type | Details |
|---|---|---|
id |
integer | not null, primary key |
description |
string | optional |
uploader_id |
integer | not null, indexed, foreign key |
created_at |
datetime | not null |
updated_at |
datetime | not null |
-
uploader_idreferencesusers - index on
uploader_id
| Column Name | Data Type | Details |
|---|---|---|
id |
integer | not null, primary key |
body |
string | not null |
author_id |
integer | not null, indexed, foreign key |
parent_comment_id |
integer | indexed, foreign key |
video_id |
integer | not null, indexed, foreign key |
created_at |
datetime | not null |
updated_at |
datetime | not null |
-
author_idreferencesusers -
video_idreferencesvideos -
parent_comment_idreferencescomments - indexed on
[:author_id, :video_id, :parent_comment_id]
| Column Name | Data Type | Details |
|---|---|---|
id |
integer | not null, primary key |
user_id |
integer | not null, indexed, foreign key |
likeable_id |
integer | not null, indexed |
likeable_type |
string | not null, indexed |
created_at |
datetime | not null |
updated_at |
datetime | not null |
-
user_idreferencesusers - index on
[:likeable_id, :likeable_type, :user_id] unique: true -
likeable_idreferencescomments -
likeable_idreferenceslikes
| Column Name | Data Type | Details |
|---|---|---|
id |
integer | not null, primary key |
follower_id |
integer | not null, indexed, foreign key |
followee_id |
integer | not null, indexed, foreign key |
created_at |
datetime | not null |
updated_at |
datetime | not null |
-
follower_idreferencesusers -
followee_idreferencesusers - index on
[:follower_id, :followee_id] unique: true
| Column Name | Data Type | Details |
|---|---|---|
id |
integer | not null, primary key |
viewer_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 |
-
viewer_idreferencesusers -
video_idreferencesvideos